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

Re: BUG: check-ref-format and rev-parse can not handle branches with an @ in their name combined with @{u}

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2014, 23:45 UTC
Message-ID
<xmqqvbxm2kmg.fsf@gitster.dls.corp.google.com>
In-Reply-To
<52D5C296.7050906@lge.com>
Keith Derrick <keith.derrick@lge.com> writes:
> I couldn't find a duplicate in the JIRA instance.
Don't worry, we do not use any JIRA instance ;-)
> According to the documentation of check-ref-format, a branch name such 
> as @mybranch is valid.
Correct.
> Yet 'git check-ref-format --branch @mybranch@{u}' 
> claims @mybranch is an invalid branch name.
I do not think it claims any such thing.
    $ git check-ref-format --branch @foo@{u}; echo $?
    fatal: '@foo@{u}' is not a valid branch name
    128
    $ git check-ref-format --branch @foo; echo $?
    @foo
    0

The former asks "Is the string '@foo@{u}' a suitable name to give a branch?" and the answer is no. The latter asks the same question about the string '@foo', and the answer is yes.

So I do not see any bug here.
Previous: Keith DerrickNext: Jeff King
Message 2 of 12 in “BUG: check-ref-format and rev-parse can not handle branches with an @ in their name combined with @{u}”
  1. Keith DerrickJan 14, 2014
  2. Junio C HamanoJan 14, 2014
  3. Jeff KingJan 15, 2014
  4. Junio C HamanoJan 15, 2014
  5. Jeff KingJan 15, 2014
  6. 0/5 interpret_branch_name bug potpourriJeff King, Jan 15, 2014
  7. 1/5 interpret_branch_name: factor out upstream handlingJeff King, Jan 15, 2014
  8. 2/5 interpret_branch_name: rename "cp" variable to "at"Jeff King, Jan 15, 2014
  9. 3/5 interpret_branch_name: always respect "namelen" parameterJeff King, Jan 15, 2014
  10. 4/5 interpret_branch_name: avoid @{upstream} past colonJeff King, Jan 15, 2014
  11. 5/5 interpret_branch_name: find all possible @-marksJeff King, Jan 15, 2014
  12. Junio C HamanoJan 15, 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.