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

Re: git-fetch remote tag to local branch fails

From
SBSanti Béjar <sbejar@gmail.com>
Date
Jun 24, 2008, 16:11 UTC
Message-ID
<8aa486160806240911p49d7bcb8q82a8d68c51206543@mail.gmail.com>
In-Reply-To
<33f4f4d70806240831q14caacddp66645e1bcfb6d14b@mail.gmail.com>
On Tue, Jun 24, 2008 at 17:31, Klas Lindberg <klas.lindberg@gmail.com> wrote:
Show 5 quoted lines
>
>> Can you explain why you have to do it this way? Or the whole workflow?
>
> I am looking into the possibility of writing a tool that handles
> configurations of trees.
Maybe you should be using the plumbing commands.
> For instance, I want the tool to be able to
> consume some version of a configuration and create, update or reset
> branches in other trees accordingly.
What are the "other trees"?
Do you mean this?
1. You have a repository with different branches as:
  master
  tree1
  tree2
  ..
2. You want /path/to/tree1 to always checkout tree1
  and the same for treeN
Then
3. In /path/to/treeN/.. you do:
$ git clone /path/to/repo treeN
$ git checkout -b treeN origin/treeN
4. To keep uptodate:
$ git pull
5. The branches for the other trees are always uptodate in origin/*.
> The main stumbling block is actually that a lot of git commands have
> side effects on the working tree (usually because they do something
> with a "current" branch).

Sure. So you have to choose those that don't have these "side effects", you have plenty of them, mainly in the low-level, plumbing commands.

> In my mind, the user should be able to
> select a configuration that effectively fast forwards branches in some
> trees and resets branches in others -- all of it without touching any
> working trees (unless there is an explicit checkout).

Well, if you touch the current branch, for sure, you want to update the working tree.

Maybe you want to keep your local branches up to date with respect their tracking branch?

> The example in this case is that fetching tags to update a branch
> isn't possible.

I don't see the point updating a branch with a tag, but you can make a tool to update a branch with a tag, see for example contrib/examples/git-fetch.sh.

Santi
Previous: Klas LindbergNext: Klas Lindberg
Message 7 of 10 in “git-fetch remote tag to local branch fails”
  1. Klas LindbergJun 24, 2008
  2. Santi BéjarJun 24, 2008
  3. Klas LindbergJun 24, 2008
  4. Santi BéjarJun 24, 2008
  5. Klas LindbergJun 24, 2008
  6. Klas LindbergJun 24, 2008
  7. Santi BéjarJun 24, 2008
  8. Klas LindbergJun 25, 2008
  9. Jakub NarebskiJun 25, 2008
  10. Michael J GruberJun 24, 2008

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.