[GRLUG] Grep'ing a diff

Dave Brondsema dave at brondsema.net
Wed Sep 2 23:21:37 EDT 2009


Adam Tauno Williams wrote:
> I have a Hg repository.  Is there a reasonably easy way to grep-a-diff?
> That is: list every file whose diff (hg diff) contains the specified
> string?
> 

Convert repo to git, then run `git diff -Smystring`  Sorry that probably
doesn't help, but I was just looking at git diff and found it builtin there.

It's ugly, but I'd probably end up doing `hg diff > hg.diff && grep -n
mystring hg.diff` then manually look at those line numbers in the
hg.diff file.

I haven't used `hg grep` before, but it sounds like you could commit
your changes (to a branch) and then use it.


-- 
Dave Brondsema : dave at brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
               <><

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
Url : http://shinobu.grlug.org/pipermail/grlug/attachments/20090902/c0ef475a/attachment.pgp 


More information about the grlug mailing list