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

Re: Request for adding a "clean" merge strategy for a double-commit merge to deal with conflicts separately

From
AAlireza <rezaxm@gmail.com>
Date
Jul 21, 2020, 16:15 UTC
Message-ID
<CAD9n_qi=9Dm83g+dJ42m+CJKtjzm7M9_x2cCi5_iHmYr6vDQEA@mail.gmail.com>
In-Reply-To
<xmqqo8ofgycz.fsf@gitster.c.googlers.com>

Say I'm merging from upstream with 100 changed files, but I only get two conflicts. If I manually resolve those, the changes I made in the process is actually lost in a large merge diff. What I'm trying to do is to separate those manual changes from anything else that could merge without conflict.

Show 5 quoted lines
> What would the "clean" (by your definition) result have in that
> block of contents that actually has a conflict?  Do you mean to say
> "Pick our version and ignore theirs in the blocks where the changes
> conflict"?  If so perhaps -Xours merge strategy option that the
> recursive backend offers is what you are looking for?

That's actually what I first tried. But when I use -Xours, I can't run `git merge <previous>` again to reproduce those conflicting hunks - because the resulting commit is deemed to be in sync with both parents. As a result, all the upstream changes are now overridden in this side branch.

Previous: Junio C HamanoNext: Elijah Newren
Message 4 of 8 in “Request for adding a "clean" merge strategy for a double-commit merge to deal with conflicts separately”
  1. AlirezaJul 16, 2020
  2. Michal SuchánekJul 16, 2020
  3. Junio C HamanoJul 16, 2020
  4. AlirezaJul 21, 2020
  5. Elijah NewrenJul 21, 2020
  6. AlirezaJul 21, 2020
  7. Elijah NewrenJul 21, 2020
  8. Junio C HamanoJul 21, 2020

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.