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

Re: git-apply that handles rejects like merge conflicts

From
Ori Avtalion <ori@avtalion.name>
Date
Nov 7, 2011, 23:18 UTC
Message-ID
<4EB86741.7040809@avtalion.name>
In-Reply-To
<20111107225508.GB28188@sigill.intra.peff.net>
On 11/08/2011 12:55 AM, Jeff King wrote:
> If it's an actual git diff, the same 3-way trick will yield good
> results, and it would be nice if it were easier to do that trick without
> calling "git am". But if it's not a git diff (i.e., missing the original
> blob information), then you won't be able to do that.

I'm dealing with two codebases that have branched in the past, before any VCS was used, and now I'm tracking both separately with git. I'm trying to apply changes from one to the other with format-patch and git-am/apply. So yeah, no blob info.

Show 7 quoted lines
> In the general case, you can't represent all failed hunks with conflict
> markers, can you? I'm thinking something where we couldn't find any
> relevant context. You know the lines from the original patch from the
> hunk header, so you can drop the failed content from the patch in the
> right spot. But how do you know how big a conflict marker to make for
> the "current" side? The same number of lines as were in the hunk?
> I think you'd end up with confusing conflict markers.

Personally, I wouldn't object to having both "computable" conflicts, and the .rej files for hunks that lack context, but I see how that would be very confusing. :)

-Ori
Previous: Jeff KingNext: Junio C Hamano
Message 3 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.