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

Re: unclear documentation of git fetch --tags option and tagopt config

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2012, 00:13 UTC
Message-ID
<7vd2ydwkwb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<084AB408ED4E4CF3B048B8615658F158@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
> What would be the best way of updating the documentation to clarify the 
> point? Given ch3cooli's previous surprise.

Oh, thanks for bringing it up. I was about to start another message that begins with "Having said all that..." ;-)

I think the entire paragraph should be rewritten. The first long sentence explains that you will get tags that point at the branches and other stuff you follow by default, so there is no need to explicitly ask for tags most of the time. While that is true, it is secondary in describing what "--tags" is about. It is to grab all tags and store them locally, and that needs to come at the very beginning.

And that auto-following behaviour is already described in the previous entry for -n/--no-tags. So how about something like this:

	This is a short-hand for giving "refs/tags/*:refs/tags/*"
	refspec from the command line, to ask all tags to be fetched
	and stored locally.

Note that it is deliberate that the above does not mention tagopt configuration at all. The variable was primarily meant to be used with --no-tags, so that with this:

    [remote "origin"] tagopt = --no-tags

you can "git fetch origin" to keep up with the development on branches without having to fetch tags from there. Fetching tags and only tags from a remote is almost always not what you want; in other words, remote."origin".tagopt set to --tags is a misconfiguration 99% of the time, unless you are only interested in following tagged release points.

Previous: Philip Oakley
Message 4 of 4 in “unclear documentation of git fetch --tags option and tagopt config”
  1. 乙酸鋰Dec 13, 2012
  2. Junio C HamanoDec 13, 2012
  3. Philip OakleyDec 13, 2012
  4. Junio C HamanoDec 14, 2012

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.