git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: questions about cg-update, cg-pull, and cg-clone.

From
JBJoel Becker <joel.becker@oracle.com>
Date
May 3, 2005, 15:59 UTC
Message-ID
<20050503155915.GV4747@ca-server1.us.oracle.com>
In-Reply-To
<20050503152214.GA1704@tumblerings.org>
On Tue, May 03, 2005 at 08:22:15AM -0700, Zack Brown wrote:
Show 6 quoted lines
> 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
Previous: Zack BrownNext: Joel Becker
Message 6 of 8 in “questions about cg-update, cg-pull, and cg-clone.”
  1. Zack BrownApr 30, 2005
  2. David A. WheelerApr 30, 2005
  3. Zack BrownApr 30, 2005
  4. Petr BaudisMay 2, 2005
  5. Zack BrownMay 3, 2005
  6. Joel BeckerMay 3, 2005
  7. Joel BeckerMay 3, 2005
  8. Daniel BarkalowMay 3, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.