Re: [BUG?] Patches created with 'diff.noprefix=true' don't 'git apply'.

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

 



Nathan Collins wrote:
> On Wed, Apr 30, 2014 at 7:40 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
>> Nathan Collins wrote:

>>> git show | git apply --reverse
>>
>> The following which only uses plumbing commands should work:
>>
>>         git diff-tree -p HEAD^! |
>>         git apply --reverse
>
> Nice! However, I don't now how to generalize this solution to other
> (probably insane) use cases, e.g.
>
>   git log -S<string> --patch | git apply --reverse

This should do it:

	git rev-list HEAD |
	git diff-tree --no-commit-id -p -S<string> --stdin |
	git apply --reverse

More generally, when scripting plumbing commands tend to do the right
thing.

Will think more about the documentation and other parts (or if someone
else sends a patch before I can, I won't mind).

Thanks,
Jonathan
--
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]