All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Igor Lautar <igor.lautar@gmail.com>
Cc: Tomas Carnecky <tomas.carnecky@gmail.com>, git@vger.kernel.org
Subject: Re: commit gone after merge - how to debug?
Date: Mon, 26 Nov 2012 15:50:15 +0100	[thread overview]
Message-ID: <vpqa9u4pgew.fsf@grenoble-inp.fr> (raw)
In-Reply-To: <CAO1Khk8=nrKknfqY-k6XaGPDbLrHyrK-8fxfB7XXUWeB7L4EUA@mail.gmail.com> (Igor Lautar's message of "Mon, 26 Nov 2012 14:58:38 +0100")

[ Jumping back in time ]

Igor Lautar <igor.lautar@gmail.com> writes:

>> Try this:
>>
>> commit=<sha1 of your merge commit>
>> # Show diff with first parent:
>> git diff "$commit" "$commit"^1
>> # Show diff with second parent:
>> git diff "$commit" "$commit"^2
>
> Yes, change is shown in commit^2, but actual file after merge does not have it.

My commands had the wrong order. It should have been git diff
"$commit"^2 "$commit". So, it showed the reverse of the modification
introduced by the commit. If you see your change here, it means the
change was reverted by the merge.

My understanding of the situation up to now is:

M
|\
A C
|/
B

($commit = M, $commit^1 = A and $commit^2 = B)

Your file had a content (say, "old") at revision B. It changed content
(say, to "new") at revision C, and at some point. A did not change it so
it had the content "old". Then you merged, expected the merge commit M
to get content "new", and actually got "old".

So, your history looks like:

M (old)
| \
|  `---.
|       \
A (old)  C (new)
|       /
|  .---'
| /
|/
B (old)

and "git diff C M" shows the diff between new and old.

Something went wrong during the merge, I guess it used an ancestor (B
above) that had "new" as content. I don't see how this happened (rather
clearly, your history is more complex than my example above), but
"GIT_MERGE_VERBOSITY=5 git merge" will show you which common ancestor
was used, it may help.

What's possible is that someone had already merged the branch containing
"new", got conflicts, and resolved it in favor of "old" somewhere in the
history of your master branch.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  parent reply	other threads:[~2012-11-26 14:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 13:06 commit gone after merge - how to debug? Igor Lautar
2012-11-26 13:10 ` Tomas Carnecky
2012-11-26 13:23   ` Matthieu Moy
2012-11-26 13:29     ` Igor Lautar
2012-11-26 13:38       ` Matthieu Moy
2012-11-26 13:58         ` Igor Lautar
2012-11-26 14:03           ` Matthieu Moy
2012-11-26 14:15             ` Igor Lautar
2012-11-26 14:19               ` Matthieu Moy
2012-11-26 14:23                 ` Igor Lautar
2012-11-26 14:50           ` Matthieu Moy [this message]
2012-11-26 17:01             ` Igor Lautar
2012-11-26 13:24   ` Igor Lautar

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=vpqa9u4pgew.fsf@grenoble-inp.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=igor.lautar@gmail.com \
    --cc=tomas.carnecky@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.