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

Re: [PATCH] Do not allow refnames to start with a slash

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 25, 2011, 18:17 UTC
Message-ID
<7v39gpmk3x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1314259695-30801-1-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 8 quoted lines
> diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
> index 1b0f82f..b05ca26 100755
> --- a/t/t1402-check-ref-format.sh
> +++ b/t/t1402-check-ref-format.sh
> @@ -18,6 +18,10 @@ invalid_ref 'foo'
>  valid_ref 'foo/bar/baz'
>  valid_ref 'refs///heads/foo'
>  invalid_ref 'heads/foo/'
> +invalid_ref '/foo'
> +invalid_ref '/foo/bar'

As refs///heads/foo is defined to be valid_ref, I am moderately against this change, which can break existing scripts.

> +invalid_ref 'foo/'
> +invalid_ref 'foo/bar/'

We already check trailing slash in existing checks, so I do not see a point in these two additional lines.

>  invalid_ref './foo'
>  invalid_ref '.refs/foo'
>  invalid_ref 'heads/foo..bar'

I was about to write "other than that the patch looks good", but then realized there is nothing remaining after rejecting the new "now slash cannot come at the beginning".

Previous: Michael HaggertyNext: Michael Haggerty
Message 7 of 10 in “Buggy handling of non-canonical ref names”
  1. Michael HaggertyAug 24, 2011
  2. Junio C HamanoAug 24, 2011
  3. Carlos Martín NietoAug 24, 2011
  4. Junio C HamanoAug 24, 2011
  5. Michael HaggertyAug 25, 2011
  6. Do not allow refnames to start with a slashMichael Haggerty, Aug 25, 2011
  7. Junio C HamanoAug 25, 2011
  8. check-ref-format --print: Normalize refnames that start with slashesMichael Haggerty, Aug 25, 2011
  9. Junio C HamanoAug 25, 2011
  10. Michael HaggertyAug 25, 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.