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

Re: [COGITO PATCH] cg-branch-switch and local branches

From
SBSanti Béjar <sbejar@gmail.com>
Date
Jun 1, 2005, 14:41 UTC
Message-ID
<87mzqaqgv1.fsf@gmail.com>
In-Reply-To
<87ekbmi5zl.fsf@ifae.es>
Hi,
        after reading it I think I have to explain it better.
        And first I have to say that this patch depends on my patches
        in the thread "[COGITO PATCH] Heads and tags in subdirectories".
        But the logic does not depend on it, I think :)
Suppose I want to make some modifications to the cogito. So I do:
cg-clone cogito rsync://rsync.kernel.org/pub/scm/cogito/cogito.git

the first argument been the name I've gave to this repositori. Now I can do the changes/commits in the usual way. But I want to work in two differents patches, named dirs and switch, so I do:

cg-branch-add dirs cogito cg-branch-add switch cogito

Now I have to local branches with their respective names, and the origin been the cogito branch for both (but it can be different).

If I want to work on the dirs branch I do:
cg-branch-switch dirs
an the same for switch. In each case I can do a:
cg-merge origin
and merge their respective origin (in this case is the same).
If I want to work directly in cogito, I can do:
cg-branch-switch cogito

and work in the usual way. If the cogito repository have a branche called cogito2 I could do:

cg-branch-switch cogito#cogito2
in the case I've already pulled this branch.
Internally it is:

Local branches --------------

The master file is always a link:
master -> ${localbranch}

The content of $_git/branches/${localbranch} is the original branch of local branch. The cases and the corresponding origin links are:

1a.- name         : a name of an external repository
                    $branch corresponding to the definition
                    origin -> $name/$branch
1b.- name#branch : optionally with a branch
                    origin -> $name/$branch
2 .- name         : a name of another local branch
                    $branch corresponding to the definition
                    origin -> $name/$branch

Local unnamed branches ----------------------

The master file is a regular file and the origin link only has the cases 1a and 1b where the $name is name of the local branch.

Previous: Santi BéjarNext: Santi Béjar
Message 2 of 4 in “cg-branch-switch and local branches”
  1. cg-branch-switch and local branchesSanti Béjar, Jun 1, 2005
  2. Santi BéjarJun 1, 2005
  3. Santi BéjarJun 1, 2005
  4. Santi BéjarJun 2, 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.