Subject: Re: [stgit PATCH] commands.{new,rename}: verify patch names

From: Max Kellermann <[email-masked]>
Date: Tue, 5 Oct 2010 14:52:25 +0200

On 2010/10/05 14:44, Gustav Hållberg <[email-masked]> wrote:
> On Tue, Oct 5, 2010 at 1:45 PM, Max Kellermann <[email-masked]> wrote:
> > +def check_patch_name(name):
> > +    """Checks if the specified name is a valid patch name. For
> > +    technical reasons, we cannot allow a slash and other characters."""
> > +    return len(name) > 0 and name[0] != '.' and re.search(r'[\x00-\x20]', name) is None
> 
> I don't quite understand how the above would filter out slashes.

Oh damn, you're right.  I had slashes explicitly forbidden in a
previous revision of my patch, that got lost when I added my "kill all
whitespace" change.  I'll resubmit.

>  sh$ git tag -- --foo
>  sh$ git rev-parse --foo
>  <failure>

I guess this is a problem because "git-rev-parse" doesn't follow the
convention of the "--" option separator.