public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle•com>
To: Zack Brown <zbrown@tumblerings•org>
Cc: Petr Baudis <pasky@ucw•cz>, Git Mailing List <git@vger•kernel.org>
Subject: Re: questions about cg-update, cg-pull, and cg-clone.
Date: Tue, 3 May 2005 08:59:15 -0700	[thread overview]
Message-ID: <20050503155915.GV4747@ca-server1.us.oracle.com> (raw)
In-Reply-To: <20050503152214.GA1704@tumblerings.org>

On Tue, May 03, 2005 at 08:22:15AM -0700, Zack Brown wrote:
> So, suppose I'm working on your Cogito HEAD. I make some changes to my local
> tree and commit them to my tree, and then before I go forward, I want to grab
> whatever you've done recently, to make sure we're not in conflict before I add
> new changes. If I understand you right, this situation would be a 'fast forward
> merge'. So what is the command I give to just 'merge' your HEAD with mine,
> without requiring a changelog entry?

	Remember that HEAD is merely a SHA1 of the toplevel tree object.
Imagine you have the simplest tree, one directory containing one file.
The file has the has hash aaaaaa.  The tree object containing it has the
hash bbbbbb.  So, HEAD contains bbbbbb.
	Now you update from Petr, having made no changes.  You pull his
newest tree, which also has a new file.  That new file has the hash
cccccc.  The new tree object, containing both files, now has the hash
dddddd.  HEAD now contains dddddd.  As you are in a matching state to
his tree, you have not done anything interesting to your tree, and there
is no commit.  This is a "fast-forward" merge.
	Then you change the first file, adding a few functions.  You
commit it, and it now has the hash 111111.  This change means the tree
hash becomes 222222.  So, HEAD contains 222222.
	You then update from Petr again.  He's changed the second file.
It's hash is no longer cccccc, it's eeeeee.  In his tree, the hash of
the tree is 333333 (from file 1's aaaaaa and file 2's eeeeee).  But the
hash of your tree is 444444 (from your local file 1's 111111 and file 2's eeeeee).  So, the hash of the your tree becomes 444444.  Your HEAD contains 444444.
This does _not_ match his 333333 HEAD.  You are committing the
combination of his change and yours.  He is saying that this work, which
may have required hand-merging or commit resolution, is "interesting"
information.

Joel

-- 

Life's Little Instruction Book #69

	"Whistle"

Joel Becker
Senior Member of Technical Staff
Oracle
E-mail: joel.becker@oracle•com
Phone: (650) 506-8127

  reply	other threads:[~2005-05-03 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-30  0:53 questions about cg-update, cg-pull, and cg-clone Zack Brown
2005-04-30  2:37 ` David A. Wheeler
2005-04-30 15:48   ` Zack Brown
2005-05-02 19:58 ` Petr Baudis
2005-05-03 15:22   ` Zack Brown
2005-05-03 15:59     ` Joel Becker [this message]
2005-05-03 17:20       ` Joel Becker
2005-05-03 16:30     ` Daniel Barkalow

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=20050503155915.GV4747@ca-server1.us.oracle.com \
    --to=joel.becker@oracle$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pasky@ucw$(echo .)cz \
    --cc=zbrown@tumblerings$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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