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

Re: Reference has invalid format: check maybe a bit to harsh?

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2011, 19:54 UTC
Message-ID
<7vty6pos20.fsf@alter.siamese.dyndns.org>
In-Reply-To
<60007404.ge1WXNp2Qn@soybean>
Peter Oberndorfer <kumbayo84@arcor.de> writes:
> The invalid refs(about 30, loose and packed) containing a ':' were created by 
> stgit a long time ago(Dec 2006)

I think even back then colon was one of the forbidden letters in a refname. Of course, it is entirely possible that broken third-party tools may have created such file that is not a ref in .git/refs hierarchy by hand, and we may not be carefully rejecting such broken refs for a long time.

    ... Goes and asks "git blame" ...

03feddd (git-check-ref-format: reject funny ref names., 2005-10-13) started disallowing control characters and other characters that are used for range operators and the separator between LHS and RHS of refspecs, further tightened by 6828399 (Forbid pattern maching characters in refnames., 2005-12-15).

> But i'm just wondering if dieing when seeing a single invalid ref might be a 
> bit too harsh since no git tools can be used anymore on this repo at all.

I agree that we would want to give users an escape hatch. That is, if we can make something like this to work:

    c=$(git rev-parse --force refs/patches/obd_development/blah:_vari...)
    git update-ref refs/patches/obd_development/blah--various-improvements $c
I think we would be in a good shape.
Previous: Peter OberndorferNext: Junio C Hamano
Message 2 of 4 in “Reference has invalid format: check maybe a bit to harsh?”
  1. Peter OberndorferOct 31, 2011
  2. Junio C HamanoOct 31, 2011
  3. Junio C HamanoOct 31, 2011
  4. Michael HaggertyNov 1, 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.