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

Re: Strange cogito behaviour

From
Jeff King <peff@peff.net>
Date
Aug 1, 2006, 15:12 UTC
Message-ID
<20060801151258.GB3923@coredump.intra.peff.net>
In-Reply-To
<200608011053.25112.andyparkins@gmail.com>
On Tue, Aug 01, 2006 at 10:53:24AM +0100, Andy Parkins wrote:
Show 10 quoted lines
> It does the following:
>  * Create a repository, repo1, add a file to it
>  * Create a branch inside repo1 and change the file in it
>  * Switches repo1 to master branch
>  * Clones repo1 to repo2
>  * Switches repo1 to alternate branch
>  * Updates repo2
> 
> The odd behaviour is that repo2 changes in the update to show the branch 
> contents in the working copy.  The only actions that has happened in repo1 is 
A cogito fetch without a branch specifier defaults to the remote HEAD,
not master.  This is the documented behavior (see cg-branch-add(1)). I
agree it is confusing (I also thought it was a bug until I looked it up
:) ). If you want to always fetch from the master, you must say so
explicitly:
  $ cg-clone repo1#master repo2
> The script then continues with
>  * Switch repo1 back to master branch
>  * Update repo2
> This time repo2 doesn't change.  So I'm more confused :-)

This is because repo2's master is already at the branch, and repo1 is a subset of that history. There is no need to merge since repo2 already contains all of the commits in repo1 (plus another one which is only on the branch in repo1).

-Peff
Previous: Andy ParkinsNext: Andy Parkins
Message 2 of 3 in “Strange cogito behaviour”
  1. Andy ParkinsAug 1, 2006
  2. Jeff KingAug 1, 2006
  3. Andy ParkinsAug 1, 2006

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.