Friday, May 23, 2008

Showing diffs

codenotifier diff
Codenotifier is able now to show commit diffs. If commit looks interesting you can tell codenotifier to load and show the changeset by clicking 'Fetch diff'. Diff fetch is asynchronous so the same page without diff will likely be returned; diff should appear there in about 10 seconds (this really depends on server load and remote repository availability and timings). In most cases you'll get the diff after you click Refresh on the same page.

Here's an axample of already fetched diff. Btw this is when I knew Python language name origin!

See, there are permalinks to each diffed file and to each line of diff. I think ability to comment diff lines, like excellent GitHub feature, might be useful also..

Just in case, I also extracted code converting unified diff to HTML to a Ruby gem.

Previously codenotifier gave link to Trac's changeset screen for commit of project with Trac, but not every project is on Trac, and not every Trac instance (beleive it or not!) is integrated with SVN.

Saturday, May 10, 2008

Commits search

codenotifier search

Codenotifier now has seach function. It searches over projects and commits, so if you enter 'rails' you'll get 'rails' project, 'railstree' (because simple queries are automaticaly suffixed with *), and all the commits in different projects that have 'rails' in (start of) their commit message, user name or project name. Some more examples:
  • You can see how given technology is spread or just mentioned over projects, e.g. flickr, twitter, facebook.
  • In opensource projects people are often rather creative in commit messages, so you can test it with queries like "moon" or "yeah"
  • You can limit your search results to specific project, e.g. "hadoop grid*" Here we see that project name is also searched in commits search.
  • When someone's patch is included in opensourc project it's usually commited by someone else, but author is often mentioned in commit message. For such cases we can see his traces in different projects by query like this: vestbø
  • Individual fields can be queried too, e.g. we can have a list of sri's commits: author:"sri". Available fields are author, project_name and description. No field specification means everywhere. And everything can be combined: (google !project_name:a*) OR author:dant*.
  • Plain old search for some specific problem, like cache store_headers. Or you can limit it to single project: cache store_headers "httpd". Or to several projects: cache (mediawiki OR webkit). Or exclude some project: scal* -scala
In commits search project name, author and message all are searched over. And Lucene/Google search syntax works, like 'x AND y', 'x OR y', 'x y' (same as 'x AND y'), "x y" (double qoutes makes query be interpreted as complete phrase), 'x y -z', '(x OR y) -z' and so on.

For more detailed query help please see Lucene query help page. It mostly applies but have some differences, e.g. in codenotifier words are joined with AND by default; '!' works as NOT; may be something else, please comment if you find something.

Results are given in (reverse) chronological order.

Asterisk can be used in any place as a mask but can make search sometimes slow. It's added automatically to the end of query when Codenotifier thinks it's simple; and it leaves it as is if it looks advanced, i.e. contains asterisk, doublequote, AND or OR.

The search is powered by excellent Ferret and acts_as_ferret libraries, big thanks to their authors!