git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to efficiently find where a patch applies?

From
Jeff King <peff@peff.net>
Date
May 5, 2011, 20:17 UTC
Message-ID
<20110505201718.GA2533@sigill.intra.peff.net>
In-Reply-To
<20110505201204.GA31572@nwp-laptop>
On Thu, May 05, 2011 at 03:12:05PM -0500, Nathan W. Panike wrote:
> The patches were emailed as raw diffs, not as format-patch messages, so I
> thought git-am was not applicable. Also, I was applying the patches to the git
> repository on behalf of local colleagues when they ran into problems using
> 'git-apply'.

Git-am is basically just a wrapper around git-apply that will split an email message into a raw diff and a commit message. If you have raw diffs in an email, it may handle them OK, or it may be simple enough to massage them into the right form.

As far as I know, there isn't a convenient way to get "git apply" to do the same merge magic for a raw diff that "git am -3" does. It should be possible, as the only relevant input is the raw diff; I just don't think anybody has bothered to do it.

> I did not want to deal with merge conflicts---my colleagues can
> handle the conflicts themselves. So a clean merge was optimal from my
> perspective.

Ah, that makes more sense. I have been in a similar "helping people with git" situation myself.

> > Wow, dynamically generating awk using perl. That's a new one for me. :)
> You might say it is awk-ward.
Ouch. :)
-Peff
Previous: Nathan W. Panike
Message 4 of 4 in “How to efficiently find where a patch applies?”
  1. Nathan W. PanikeMay 5, 2011
  2. Jeff KingMay 5, 2011
  3. Nathan W. PanikeMay 5, 2011
  4. Jeff KingMay 5, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.