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

--no-tags doesn't appear to be working as intended

From
BDBen Denhartog <ben@sudoforge.com>
Date
May 2, 2020, 21:01 UTC
Message-ID
<7480e635-97cc-4acd-875e-54bc71a88068@www.fastmail.com>
From the documentation, it would appear that `--no-tags` should avoid pulling tags, even if they point to refs which match the refspec being fetched:
>        -n, --no-tags
>            By default, tags that point at objects that are downloaded from the remote repository are fetched and
>            stored locally. This option disables this automatic tag following. The default behavior for a remote may
>            be specified with the remote.<name>.tagOpt setting. See git-config(1). 
This, however, does not appear to be the case: Either using the `--no-tags` flag on the command line directly or setting `remote.<name>.tagopt = --no-tags` appears to be ignored when running `git-fetch`. This can be recreated simply:

``` # /tmp/a will be our "origin" # /tmp/b will be our "fork" mkdir /tmp/{a,b}

# set up the origin git -C /tmp/a init echo "Hello, world" >/tmp/a/README git -C /tmp/a add README git -C /tmp/a commit -m 'initial commit' git -C /tmp/a tag 0.0.1 HEAD

# set up the fork git -C /tmp/b init git -C /tmp/b remote add -f --no-tags upstream file:///tmp/a ```

You'll see the 0.0.1 tag being fetched. You can delete it all you want, set the `remote.upstream.tagopt = --no-tags`, etc -- it will always be pulled. This is the opposite behavior I would expect based on the available documentation and discussion around the tag in the mailing list.
-- 
  Ben Denhartog
  ben@sudoforge.com
Next: Jeff King
Message 1 of 3 in “--no-tags doesn't appear to be working as intended”
  1. Ben DenhartogMay 2, 2020
  2. Jeff KingMay 3, 2020
  3. Ben DenhartogMay 3, 2020

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.