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

Re: Why aren't tag refs namespaced?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 27, 2012, 03:26 UTC
Message-ID
<xmqq62cl7t40.fsf@junio.mtv.corp.google.com>
In-Reply-To
<CA+7g9JzpLkNHT_o1QyJ_r=4DrauWOPFr5XR_CPeAHGcLpLoD+w@mail.gmail.com>
Nathan Gray <n8gray@n8gray.org> writes:
Show 5 quoted lines
>> Other workflows that use private tags are possible and they might
>> benefit from having separate namespaces; it is just that they are not
>> the workflow Git was originally designed to support.
>
> That makes sense.

Yeah, as I said, the current behaviour aims to support a particular workflow, e.g.

 * "git fetch --tags" uses a built-in refspec "refs/tags/*:refs/tags/*"
   and that maps a tag at the remote to the same location in the refs/
   hierarchy in the local repository.
 * "git fetch" that stores the history it fetches to local repository
   (i.e. uses refspec with non-empty RHS), when run without "--no-tags",
   fetches tags that point at commits in the fetched history from the
   remote and stores them at the same location in the refs/ hierarchy.
and does it well.

But there is nothing in Git that fundamentally forces you to follow that pattern. It is entirely plausible to enhance the former (i.e. --tags) to a bool-or-string option to let you specify different refs/ hierarchy (e.g. "--tags" would use "refs/tags/*:refs/tags/*" to map the names, while "--tags=refs/remotes/origin/tags" might store fetched tags in specified place that is different from refs/tags/), and to add a new option to specify where the auto-followed tags would be stored to enhance the latter.

Previous: Nathan GrayNext: Marc Branchaud
Message 4 of 7 in “Why aren't tag refs namespaced?”
  1. Nathan GrayApr 26, 2012
  2. Junio C HamanoApr 26, 2012
  3. Nathan GrayApr 26, 2012
  4. Junio C HamanoApr 27, 2012
  5. Marc BranchaudApr 26, 2012
  6. Nathan GrayApr 26, 2012
  7. Nathan GrayApr 26, 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.