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

Re: showing conflicting merges

From
SBSanti Béjar <sbejar@gmail.com>
Date
Apr 22, 2008, 09:49 UTC
Message-ID
<8aa486160804220249y55677f63o892643775960880f@mail.gmail.com>
In-Reply-To
<20080422091233.GA12091@digi.com>

On Tue, Apr 22, 2008 at 11:12 AM, Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com> wrote:

Show 23 quoted lines
> Hello,
>
>  There is a thread on the linux-arm-kernel ML that discusses handling of
>  merge conflicts with git.[1]
>
>  I played around a bit with that and wondered about a few things:
>
>         ukleinek@zentaur:~/gsrc/linux-2.6$ git checkout -b test adf6d34e460387ee3e8f1e1875d
>         Switched to a new branch "test"
>
>         ukleinek@zentaur:~/gsrc/linux-2.6$ git merge v2.6.25
>         Auto-merged MAINTAINERS
>         CONFLICT (delete/modify): drivers/leds/leds-tosa.c deleted in HEAD and modified in v2.6.25. Version v2.6.25 of drivers/leds/leds-tosa.c left in tree.
>         Auto-merged drivers/serial/imx.c
>         Automatic merge failed; fix conflicts and then commit the result.
>
>  Now "git diff --merge" shows:
>
>         diff --cc drivers/leds/leds-tosa.c
>         index 7ebecc4,0000000..9e0a188
>         ...
>
>  Shouldn't that better be reversed, i.e. 9e0a188..7ebecc4,0000000?
It compares the versions in conflict with the version in the working copy.
Show 16 quoted lines
>
>  The resolution was to delete drivers/leds/leds-tosa.c:
>
>         ukleinek@zentaur:~/gsrc/linux-2.6$ git rm drivers/leds/leds-tosa.c
>         rm 'drivers/leds/leds-tosa.c'
>         rm 'drivers/leds/leds-tosa.c'
>
>         ukleinek@zentaur:~/gsrc/linux-2.6$ git commit
>         Created commit 99a64ab: Merge commit 'v2.6.25' into test
>
>  Now "git show" doesn't show the conflict resolution as it does for other
>  conflicting merges.
>  Adding -p and/or --cc didn't help either.  Looking at the source I think
>  the problem is that diff_tree_combined only shows diffs for paths that
>  are touched by every parent.  I'm not sure how I want to have the diff
>  shown, but showing nothing seems wrong.  Ideas?

The combined diff does not show conflicts, it only shows the merged results that are different to all the parents. In this case the merge resolution is to delete one file as in HEAD, so it won't be shown.

If you want to see the conflict resolution you have to recreate the merge and compare with the original merge.

Santi
Previous: Uwe Kleine-KönigNext: Uwe Kleine-König
Message 2 of 5 in “showing conflicting merges”
  1. Uwe Kleine-KönigApr 22, 2008
  2. Santi BéjarApr 22, 2008
  3. Uwe Kleine-KönigApr 23, 2008
  4. Santi BéjarApr 24, 2008
  5. Santi BéjarApr 24, 2008

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.