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

Re: git-apply that handles rejects like merge conflicts

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 7, 2011, 23:45 UTC
Message-ID
<7v4nyf1opf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111107225508.GB28188@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> In the general case, you can't represent all failed hunks with conflict
> markers, can you?

Conflict markers come from the use of a 3-way merge, and if you were to do a 3-way merge, by definition, you would need some way to tell where the preimage of the patch and the target tree you are attempting to apply the patch forked from. That's done by fall-back-3way in "am -3".

You _could_ lift that logic out of "am -3", but I do not think it is worth the effort to do so (IOW, I do not see a reason to avoid "am -3").

If you do not want to create a commit for whatever reason, then you can "reset --soft" back.

Previous: Ori AvtalionNext: Jeff King
Message 4 of 10 in “git-apply that handles rejects like merge conflicts”
  1. Ori AvtalionNov 7, 2011
  2. Jeff KingNov 7, 2011
  3. Ori AvtalionNov 7, 2011
  4. Junio C HamanoNov 7, 2011
  5. Jeff KingNov 8, 2011
  6. Junio C HamanoNov 8, 2011
  7. Ori AvtalionNov 8, 2011
  8. Jeff KingNov 8, 2011
  9. Bert WesargNov 8, 2011
  10. Jeff KingNov 8, 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.