Re: [PATCH/RFC 3/4] git check-ref-format --print
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Oct 12, 2009, 14:39 UTC
- Message-ID
- <20091012143922.GL9261@spearce.org>
- In-Reply-To
- <20091012053141.GD11106@progeny.tock>
Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 6 quoted lines
> +valid_ref_normalized 'heads/foo' 'heads/foo' > +valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo' > +invalid_ref_normalized 'foo' > +invalid_ref_normalized 'heads/foo/../bar' > +invalid_ref_normalized 'heads/./foo' > +invalid_ref_normalized 'heads\foo'
What about '/refs/heads/foo'? Shouldn't that drop the leading /?
I actually had someone enter that into Gerrit Code Review once, exposing a bug I have yet to fix that permits that as a valid branch name. *sigh*
FWIW, I think this is heading in the right direction. Rather than teaching the UIs how clean up a name, give us a tool to do the normalization and validation, and let us call it when we get user input.
-- Shawn.