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

From: Jonathan Nieder <[email-masked]>
Date: Mon, 5 May 2014 18:59:27 -0700

Nathan Collins wrote:
> On Wed, Apr 30, 2014 at 7:40 PM, Jonathan Nieder <[email-masked]> 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