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

git-fetch: default globally to --no-tags

From
Brian Norris <computersforpeace@gmail.com>
Date
Nov 19, 2014, 03:05 UTC
Message-ID
<20141119030523.GO22361@norris-Latitude-E6410>
Hi,

I have one main concern, and I can envision a few ways that git could solve it. I also see that there has been some previous discussion on reltaed topics over the years, but as far as I can tell, nothing has actually been implemented to address my concern.

--- My concern ---

When I fetch from a remote repository, the only ways to prevent fetching tags are:

  1) git fetch --no-tags <name>
  2) git config remote.<name>.tagopt --no-tags; git fetch <name>

The former requires extra typing for a case that (arguably) should be the default. The latter requires configuration for each repository. This doesn't scale well, if a user desires this behavior on all repositories they use.

I'd prefer something like this, to change the default tag-fetching behavior globally:

  git config --global remote.tagopt --no-tags

The closest I see is that I can disable tag-fetching globally on a per-remote name basis:

  git config --global remote.<name>.tagopt --no-tags
This brings me to a potential bug report:
--- Bug ---

When trying to use the remote.<name>.tagopt configuration option globally, I get something like this:

  $ git config --global remote.test.tagopt --no-tags
  $ git remote update
  ...
  Fetching test
  fatal: 'test' does not appear to be a git repository
  fatal: Could not read from remote repository.
  Please make sure you have the correct access rights
  and the repository exists.
  error: Could not fetch test
  ...

Expected behavior: if the local repository does not have a remote named 'test', then no additional output should be printed. If the local repository has a remote named test, then it should be fetched with the --no-tags option.

Actual behavior: git prints warnings about the 'test' remote, just because there is no remote named 'test.'

--- Motivations ---

This is all motivated by the fact that tag namespacing is completely broken in git. Tags are globally namespaced, and in a true DVCS environment, any particular developer has no control over another developer's tag naming conventions. So this namespace can easily become polluted, reducing the usefulness of tags as a whole [1]. This problem seems to have been acknowledged, and proposals appeared a few years ago [2]. But I don't see any solution for tag namespacing.

So, my current approach is to try to limit the damage done by accidentally fetching tags. Unfortunately, I can't find any good supported mechanisms to help me in the previous two sections.

--- TL;DR ---
My email boils down to two questions:
  (A) Has there been progress on implementing a proposal like in [2]?
  (B) Can we allow disabling (auto)tag-fetching globally? Like:
        git config --global remote.tagopt --no-tags

Thanks, Brian

[1] I could elaborate with some horror stories, to describe how this
    becomes a day-to-day nuisance in using git for me, but I'll avoid
    the details for now. Please accept that this is a usability bug.
[2]
    http://article.gmane.org/gmane.comp.version-control.git/165799
    http://article.gmane.org/gmane.comp.version-control.git/165885
Next: Jeff King
Message 1 of 6 in “git-fetch: default globally to --no-tags”
  1. Brian NorrisNov 19, 2014
  2. Jeff KingNov 19, 2014
  3. Junio C HamanoNov 19, 2014
  4. Jeff KingNov 19, 2014
  5. Junio C HamanoNov 19, 2014
  6. Jeff KingNov 19, 2014

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.