git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Nathan Collins <nathan.collins@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [BUG?] Patches created with 'diff.noprefix=true' don't 'git apply'.
Date: Mon, 5 May 2014 18:59:27 -0700	[thread overview]
Message-ID: <20140506015927.GV9218@google.com> (raw)
In-Reply-To: <CAO8RVveV4SgXmJzWpYnyB3rnQALQkrrLNtLL5Ej5Y9Mjjekmmw@mail.gmail.com>

Nathan Collins wrote:
> On Wed, Apr 30, 2014 at 7:40 PM, Jonathan Nieder <jrnieder@gmail.com> 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

  reply	other threads:[~2014-05-06 16:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01  1:36 [BUG?] Patches created with 'diff.noprefix=true' don't 'git apply' Nathan Collins
2014-05-01  2:40 ` Jonathan Nieder
2014-05-06  1:33   ` Nathan Collins
2014-05-06  1:59     ` Jonathan Nieder [this message]
2014-05-06 18:10     ` Junio C Hamano
2014-05-06 19:36       ` Nathan Collins
2014-05-06 21:12         ` Junio C Hamano
2014-05-07  1:16           ` Nathan Collins
2014-05-07 18:42             ` Junio C Hamano
2014-05-07 23:39               ` Nathan Collins
2014-05-08  4:38                 ` Nathan Collins
2014-05-08  4:53                   ` Nathan Collins
2014-05-08 16:56                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140506015927.GV9218@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=nathan.collins@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).