git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Patrick Doyle <wpdster@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: How to tell what paths changed in a merge?
Date: Mon, 28 Mar 2011 16:20:39 -0400	[thread overview]
Message-ID: <20110328202039.GA27755@sigill.intra.peff.net> (raw)
In-Reply-To: <AANLkTi=DOf0beuts8TO0c5JJtDtjNAcQ_4hcKNkZoXjM@mail.gmail.com>

On Mon, Mar 28, 2011 at 03:48:01PM -0400, Patrick Doyle wrote:

> I have a situation where somebody got confused while trying to
> commit/push/pull from the repository and some changes to some files
> got lost.
> 
> How can I tell which files got selected in a merge?

I'm not exactly sure what you mean by "selected". A merge commit is a
tree state with two parent commits. So you can look at what's different
in the merged state versus either parent, or there are some special ways
of looking at it all together.

You might want to try:

  # show a "combined diff"; lines with +/- in the first column came from
  # the first parent of the merge (i.e., where you were when you ran
  # "git merge" or "git pull"). The ones in the second column came from
  # the second parent (the thing you merged).
  git show -c 1e5e614

  # show a condensed combined diff; this is like "-c", except that it
  # eliminates "uninteresting" hunks, where the merge took the entire
  # hunk from one parent.
  git show --cc 1e5e614

  # show the diff of the merge commit to each of its parents
  # individually
  git show -m 1e5e614

And of course you can use those options with "git log -p" to see all of
the commits and what they did. You might also want to try "git log
--graph" to show the structure (though it is pretty hard to read with
the diffs included).

> I have a log file such as shown below (produced by "git log
> --full-history --name-status --parents --dense")

Doesn't --dense cancel out --full-history?

> I know that commit 693a2 had the correct files, but 1e5e6 does not.
> (It has an older version of the file).

Sounds like somebody botched the conflict resolution. Using the show
commands above should show you what happened in that case. Though from
the commit messages below, I don't see any mention of conflicts, which
the merge should have put in the message automatically.

So it may be that the files simply didn't change in first parent branch,
but somebody reverted them to old versions (or botched a different
merge) in the merged-in branch, with the end effect of reverting during
the merge.

If you're still confused after looking around more, and there is nothing
secret in the repo, it might work to make the repo available and tell us
what you expected to see in 1e5e6, and how it differed.

-Peff

  reply	other threads:[~2011-03-28 20:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 19:48 How to tell what paths changed in a merge? Patrick Doyle
2011-03-28 20:20 ` Jeff King [this message]
     [not found]   ` <AANLkTinhRTwbU8DXc7sYxmxjKEiHASYmdKqxofmn+wgs@mail.gmail.com>
     [not found]     ` <20110328204750.GA2998@sigill.intra.peff.net>
     [not found]       ` <AANLkTi=vB4CsMZ_hT-Mruqs6tiEjUgEzbA2Vwaog6wNK@mail.gmail.com>
2011-03-29  1:50         ` Fwd: " Patrick Doyle
     [not found]         ` <20110329014814.GA4696@sigill.intra.peff.net>
2011-03-29  2:15           ` Patrick Doyle

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=20110328202039.GA27755@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=wpdster@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).