Re: RFH - git-log variant that _does_ search through diffs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 30, 2009 at 12:31 PM, Jeff King<peff@xxxxxxxx> wrote:
>
> I think you can do this a little more simply and efficiently as:
>
>  git log -z -p --format='GREP: %s' |
>    perl -0ne 'print if /^[-+].*foo/m && !/^GREP:.*dont_want/' |
>    tr '\0' '\n'
>
> (though note that --format is new as of 1.6.3, I think; before that you
> have to use "--pretty=format:"). Many fewer process invocations, and
> less typing, though still easy to mess up.

I agree that --format leads to a much prettier solution.
Unfortunately --format seems to turn off -z (at least in msysgit):

$ git --version
git version 1.6.3.2.1299.gee46c
$ git log -p > L1
$ git log -p -z > L2
$ diff L1 L2 | wc
   2415    4347   62889
$ git log -p --format=%s > L1
$ git log -p -z --format=%s > L2
$ diff L1 L2 | wc
      0       0       0
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]