git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steven E. Harris" <seh@panix.com>
To: git@vger.kernel.org
Subject: Re: How does git follow branch history across a merge commit?
Date: Fri, 28 Aug 2009 19:50:44 -0400	[thread overview]
Message-ID: <831vmv5wh7.fsf@torus.sehlabs.com> (raw)
In-Reply-To: 7vmy5jbjkr.fsf@alter.siamese.dyndns.org

Junio C Hamano <gitster@pobox.com> writes:

> If you merge competition into your master, the resulting commit will
> have your master as its first parent.  If check out competition and
> merge master in your example, the resulting merge will have
> compatition as the first parent.

I see, having run a few more experiments to confirm this.

I missed the point that merge commits are not "predecessor neutral";
they apparently have a bias indicating "/this branch/ received content
from /that branch/ (or /those branches/)".

To try to recreate my confusing scenario, I tried this:

,----
| git checkout competition
| git merge master
| # This fast-forwarded "competition" be equivalent to "master".
| git checkout 'HEAD^'
| # This wound up again at "master"'s predecessor, not "competition"'s.
`----

It seems that since fast-forward merges don't produce a commit, the
merge record remains in place recording that branch "competition" came
into branch "master". Even though we're checked out to branch
"competition" here, following its history back in time requires some
manual intervention. Do you concur, or is my example perhaps flawed?

-- 
Steven E. Harris

  reply	other threads:[~2009-08-28 23:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 22:37 How does git follow branch history across a merge commit? Steven E. Harris
2009-08-28 23:30 ` Junio C Hamano
2009-08-28 23:32   ` Junio C Hamano
2009-08-28 23:50     ` Steven E. Harris [this message]
2009-08-29  0:01       ` Junio C Hamano
2009-08-30  0:29         ` Steven E. Harris
2009-08-29  0:25       ` Björn Steinbrink

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=831vmv5wh7.fsf@torus.sehlabs.com \
    --to=seh@panix.com \
    --cc=git@vger.kernel.org \
    /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).