Re: feature request: git add--interactive --patch on regex-matched hunks only

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

 



On Wed, Jul 27, 2011 at 04:02:48PM +0700, Nguyen Thai Ngoc Duy wrote:

> I was thinking of it as an extension of "git log -Sregex", where as -S
> shows full diff of matched files, the new option only shows hunks that
> actually match. Not sure if that is really useful though. On the other
> hand, "git diff --hunk" is useful for me, I'll see if I can add that
> option.

I think it is more like "log -Gregex", which actually greps within the
diff. It would not be too hard to adapt the "-G" code to return the set
of hunks, rather than a simple "yes we have it". If you did that, it
would make the perl bits way simpler: they would simply call "diff
-Gregex" when creating the patch.

I don't think "git diff --hunk" would be that hard, either. The
trickiest part is that the diff code tries to output lines as soon as we
get them. You'd have to buffer whole chunks.

-Peff
--
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]