Monday, 16 March 2009

Git: Directory Swiss Army Knife

Today, at work, we had two versions (labelled 1a and 1b) of over 1000 '.wav' files for the two releases of our voice application. We wanted to know which wavs existed in both 1a and 1b, but had different content. That is, if you take the intersection of the names in both sets but the symmetric difference of their content, which wavs remain? Git to the rescue:

First I created separate branches for the wavs in 1a and 1b, and then I used:

% git diff 1a 1b --name-only --diff-filter=M


This produced a list of files that had been only modified between the 1a and 1b branches!

I guess the point here is that DVCS systems can be used for reason's far beyond simply versioning code. I tend to see them more as a queryable interface over content....

No comments: