git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David A. Wheeler" <dwheeler@dwheeler.com>
To: Zack Brown <zbrown@tumblerings.org>
Cc: Git Mailing List <git@vger.kernel.org>,
	Petr Baudis <pasky@ucw.cz>,
	xpasky@machine.sinus.cz
Subject: Re: questions about cg-update, cg-pull, and cg-clone.
Date: Fri, 29 Apr 2005 22:37:29 -0400	[thread overview]
Message-ID: <4272EF69.2090806@dwheeler.com> (raw)
In-Reply-To: <20050430005322.GA5408@tumblerings.org>

Zack Brown wrote:
> Hi,
> 
> I'm trying to figure out the new Cogito syntax. What is the difference between
> cg-update and cg-pull? Here is my take so far, please correct me:
> 
> '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. "cg-update branch-name" is EXACTLY the same as
  cg-pull branch-name && cg-merge branch-name
You can see this by examining the last lines of the cg-update script.
Because updating is one of the single most common operations for an SCM,
it makes sense to have a single command that does it.

Currently cg-update without a branch name does "recover deleted files"
instead, but I think that's a wart & Petr agrees (that will probably
get moved to a different command, see separate discussion).


> Now, if the update is clean, a cg-commit is invoked automatically,

Correct; cg-merge calls "cg-commit -C" (ignore cache)
if the merge is clean.

> and if the
> update is not clean, I then have to resolve any conflicts and give the cg-commit
> command by hand.

Correct.

> 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
> I'm doing is updating my tree to be current. Why should I have to 'commit' that
> update?

I can't speak Petr, but I would guess that he's doing that because
he's trying to avoid data loss.

> 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 BRANCH copies any changes from the named branch into your
repository.  You could do a diff afterwards, yes, to get the
same results as long as the data is in your repository.  However,
after a successful merge the HEAD will be different from before
a successful merge, so the DEFAULT answers from a
diff will be different.


> Also, the README says that cg-clone and cg-init are identical, except that
> cg-clone creates a new directory for the repository. Is that really the only
> difference? Why do we have cg-clone then?

You'll have to ask Petr.  My guess is that he has bigger plans
for cg-clone, what you're seeing is just the current stub.

Anyway, hope my guessing helps.

--- David A. Wheeler

  reply	other threads:[~2005-04-30  2:29 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 [this message]
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
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=4272EF69.2090806@dwheeler.com \
    --to=dwheeler@dwheeler.com \
    --cc=git@vger.kernel.org \
    --cc=pasky@ucw.cz \
    --cc=xpasky@machine.sinus.cz \
    --cc=zbrown@tumblerings.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).