From: "Uwe Kleine-König" <Uwe.Kleine-Koenig@digi.com>
To: "Santi Béjar" <sbejar@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: showing conflicting merges
Date: Wed, 23 Apr 2008 08:17:15 +0200 [thread overview]
Message-ID: <20080423061715.GB25446@digi.com> (raw)
In-Reply-To: <8aa486160804220249y55677f63o892643775960880f@mail.gmail.com>
Hello Santi,
Santi Béjar wrote:
> On Tue, Apr 22, 2008 at 11:12 AM, Uwe Kleine-König
> <Uwe.Kleine-Koenig@digi.com> wrote:
> > 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.
I have not checked in the source code, but the output of
strace -f -e open git diff --merge 2>&1 >/dev/null | grep leds-tosa
seems to contradict that (i.e. there is no output).
7ebecc4 = v2.6.25:drivers/leds/leds-tosa.c
9e0a188 = $(git merge-base test v2.6.25):drivers/leds/leds-tosa.c
(Ah, I just see, that's another hint that diff --merge doesn't look in
the working copy. The wc has 7ebecc4 which is in the LHS together with
000000 (i.e. the deleted file from HEAD).
Maybe the combined diff format cannot have more than one rev on the RHS?
> > 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.
An option to show would be great ...
Best regards
Uwe
--
Uwe Kleine-König, Software Engineer
Digi International GmbH Branch Breisach, Küferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
next prev parent reply other threads:[~2008-04-23 6:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-22 9:12 showing conflicting merges Uwe Kleine-König
2008-04-22 9:49 ` Santi Béjar
2008-04-23 6:17 ` Uwe Kleine-König [this message]
2008-04-24 12:51 ` Santi Béjar
2008-04-24 13:08 ` Santi Béjar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080423061715.GB25446@digi.com \
--to=uwe.kleine-koenig@digi.com \
--cc=git@vger.kernel.org \
--cc=sbejar@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.