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

Re: [PATCH 2/3] object-name: don't allow @ as a branch name

From
Jeff King <peff@peff.net>
Date
Oct 8, 2024, 06:52 UTC
Message-ID
<20241008065255.GA676291@coredump.intra.peff.net>
In-Reply-To
<9a64a58b-3d08-44b4-96a5-9031863de4f1@app.fastmail.com>
On Mon, Oct 07, 2024 at 10:56:36PM +0200, Kristoffer Haugsbakk wrote:
Show 14 quoted lines
> > There's a bit of subtlety here which makes the term "invalid" somewhat
> > vague. The refname "refs/heads/HEAD" is allowed by plumbing, as we try
> > to maintain backwards compatibility there. So the current prohibition is
> > just within the porcelain tools: we won't allow "git branch HEAD"
> > because it's an easy mistake to make, even though you could still create
> > it with "git update-ref".
> 
> Got it.  Creating this one (or something like `refs/heads/HEAD` for that
> matter) is allowed by the plumbing tools.  But the porcelain ones are
> blocked.
> 
> Also the plumbing query `git check-ref-format --branch @` now returns
> false.  Since it has to harmonize with what the branch creation
> porcelain can do.

Yeah, good point. I was thinking the existing test was purely about the git-branch porcelain, but "check-ref-format --branch" follows the same rules.

Show 5 quoted lines
> > And naturally we'd want the same rules for "refs/heads/@". I think it
> > might be worth adding "...in plumbing" to the end of the subject, and/or
> > calling out this distinction in the text.
> 
> Did you mean something like “disallow in porcelain”?
Oops, yes, I had it backwards. Good catch.
-Peff
Previous: Kristoffer HaugsbakkNext: Rubén Justo
Message 6 of 18 in “object-name: don't allow @ as a branch name”
  1. 0/3 object-name: don't allow @ as a branch nameKristoffer Haugsbakk, Oct 7, 2024
  2. 1/3 object-name: fix whitespaceKristoffer Haugsbakk, Oct 7, 2024
  3. 2/3 object-name: don't allow @ as a branch nameKristoffer Haugsbakk, Oct 7, 2024
  4. Jeff KingOct 7, 2024
  5. Kristoffer HaugsbakkOct 7, 2024
  6. Jeff KingOct 8, 2024
  7. Rubén JustoOct 8, 2024
  8. Junio C HamanoOct 7, 2024
  9. Jeff KingOct 8, 2024
  10. 3/3 t1402: exercise disallowed branch namesKristoffer Haugsbakk, Oct 7, 2024
  11. Jeff KingOct 7, 2024
  12. Jeff KingOct 7, 2024
  13. Kristoffer HaugsbakkOct 7, 2024
  14. shejialuoOct 8, 2024
  15. Kristoffer HaugsbakkOct 8, 2024
  16. shejialuoOct 18, 2024
  17. Junio C HamanoOct 8, 2024
  18. shejialuoOct 9, 2024

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.