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

Re: Branch names with slashes

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2011, 00:10 UTC
Message-ID
<7vhb11l6ki.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4EEA777C.6040607@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> I don't believe that it would be possible to relax this limitations
> without at least a little breakage of backwards compatibility.

I do not think it is worth it, but you _could_ update your git to use a file whose name is "refs/heads/.foo/bar" as the representation of foo/bar branch and refs.c API, especially the ones close to resolve_ref(), should be the only ones that need to know about this. While walking the filesystem in refs/ hierarchy, any directory you see whose name do not begin with dot you would treat it as a legacy one and perhaps rename it to match the new convention on the fly.

> What is the bottom line?  Feel free to submit patches to improve the
> documentation or error reporting.  But I doubt that the underlying
> limitation will be removed.

I do not think so either. It is not even a limitation but is a basic nature of "hierarchical names".

Previous: Michael HaggertyNext: Johannes Sixt
Message 5 of 6 in “Branch names with slashes”
  1. Leonardo KimDec 14, 2011
  2. Michael HaggertyDec 14, 2011
  3. Neal KreitzingerDec 15, 2011
  4. Michael HaggertyDec 15, 2011
  5. Junio C HamanoDec 16, 2011
  6. Johannes SixtDec 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.