Getting Historic Revisions of Drupal Modules for Comparison

Comments

Khalid writes:

Hey Greg

Your grep works only if the Id is in the first 3 lines. There are cases where someone has some comments and stuff before the actual $Id$ string.

Here is a better grep that will catch them anywhere:

find ./ -name '*.module' -exec grep "\$Id" {} \; >> versionNumbers.txt

Greg writes:

Thanks for the idea, Khalid.

With shell commands there are many ways to skin the cat - your grep has the benefit of working when the $Id tag is beyond the first three lines, but has the drawback of potentially matching a variable later in the file named $Id. We don't use varialbes like that in Drupal very often, but it could happen.

In my use I found that they were all within the first 3 lines. It's a trade-off of what works for a specific situation, but your modification is definitely a good alternative for people to keep in mind.