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

Re: remote branches

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2011, 06:12 UTC
Message-ID
<7vmxlzuouj.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110213103156.GB4202@atjola.homenet>
Björn Steinbrink <B.Steinbrink@gmx.de> writes:
Show 17 quoted lines
> It's ok for fetch to treat --tags like a refspec and to have it override
> the defaults from the config when the user manually specifies it on the
> command line. But when it is part of the default configuration it should
> add to remote.<name>.fetch, not override it.
>
> IOW with this configuration:
> remote.foo.url = git://host/repo.git
> remote.foo.fetch = +refs/heads/*:refs/remotes/foo/*
> remote.foo.tagopt = --tags
>
> "git fetch foo" acts like:
>
> git fetch --tags git://host/repo.git
>
> instead of
>
> git fetch --tags git://host/repo.git +refs/heads/*:refs/remotes/foo/*

I would agree that the behaviour of tagopt acting exactly as if the options were given from the command line is an ungly hack, not an intended behaviour. Interested in coming up with a proposed approach for a fix?

I would say --tags from the command line probably outlived its original purpose; back when we didn't have the reliable automatic following, sometimes people needed to say "fetch --tags" to complete the set of tags. The description in config.txt for --tags also cites another purpose, namely, to fetch tags otherwise totally unrelated to the branches you are following, but in reality there is no sensible use case to require such a feature. Yes, you may have many unrelated lines of development with separate set of tags on them, but then --tags to fetch _all_ tags from all of these unrelated lines of development is a too coarse-grained tool to be useful.

Note that "fetch --tags" without following any of the branches _is_ a sensible setting for a rather common workflow.

For every active developer who will have his own private changes in the repository, there would be 100 passive followers who would fetch the branches of the project and build the bleeding edge (i.e. nightly builders) and these two classes of people would benefit from having "refs/heads/*:refs/remotes/origin/*" refspec. And for each of these people, there would be 100 people who would be interested only in tagged releases. They of course could download tarballs, but they can instead say "fetch --tags", check out the latest tagged release and use it.

Previous: Björn SteinbrinkNext: Christian Jaeger
Message 7 of 8 in “remote branches”
  1. Matthieu ImbertFeb 13, 2011
  2. Ævar Arnfjörð BjarmasonFeb 13, 2011
  3. Matthieu ImbertFeb 13, 2011
  4. Andreas SchwabFeb 13, 2011
  5. Matthieu ImbertFeb 13, 2011
  6. Björn SteinbrinkFeb 13, 2011
  7. Junio C HamanoFeb 14, 2011
  8. Christian JaegerFeb 16, 2011

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.