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

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

From
Petr Baudis <pasky@ucw.cz>
Date
May 2, 2005, 19:58 UTC
Message-ID
<20050502195846.GC20818@pasky.ji.cz>
In-Reply-To
<20050430005322.GA5408@tumblerings.org>

Dear diary, on Sat, Apr 30, 2005 at 02:53:22AM CEST, I got a letter where Zack Brown <zbrown@tumblerings.org> told me that...

> 'cg-update branch-name' grabs any new changes from the upstream repository and
> merges them into my local repository. If I've been editing files in my local
> repository, the update attempts to merge the changes cleanly.
Yes.
> Now, if the update is clean, a cg-commit is invoked automatically, and if the
> update is not clean, I then have to resolve any conflicts and give the cg-commit
> command by hand. But: what is the significance of either of these cg-commit
> commands? Why should I have to write a changelog entry recording this merge? All

You might want to write some special notes regarding the merge, e.g. when you want to describe some non-trivial conflict resolution, or even give a short blurb of the changes you are merging.

If you don't know what to say, just press Ctrl-D. The first line of the commit always says "Merge with what_you_are_merging_with".

> I'm doing is updating my tree to be current. Why should I have to 'commit' that
> update?

If you are only updating your tree to be current, you don't have to commit, and in fact you don't commit (you do so-called "fast-forward merge", which will just update your HEAD pointer to point at the newer commit). You commit only when you were merging stuff (so-called "tree merge"; well, that's at least how I call it to differentiate it from the fast-forward merge). That means you have some local commits over there - I can't just update your tree to be current, sorry. That would lose your commit. I have to merge the changes into your tree through a merge commit.

> Now I look at 'cg-pull'. What does this do? The readme says something about
> printing two ids, and being useful for diffs. But can't I do a diff after a
> cg-update and get the same result? I'm very confused about cg-pull right now.

cg-pull does the first part of cg-update. It is concerned by fetching the stuff from the remote repository to the local one. cg-merge then does the second part, merging the stuff to your local tree (doing either fast-forward or tree merge).

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Zack BrownNext: Zack Brown
Message 4 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.