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

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

From
GHGustav Hållberg <gustav@gmail.com>
Date
Oct 5, 2010, 12:44 UTC
Message-ID
<AANLkTin9PyfY+-1=mJKMZa2FJ5YC2D27iPtiocCWY+eP@mail.gmail.com>
In-Reply-To
<20101005114541.15037.53617.stgit@woodpecker.blarg.de>
On Tue, Oct 5, 2010 at 1:45 PM, Max Kellermann <max@duempel.org> 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.

There are also other types of names that won't work correctly in git, such as names starting with (double?) hyphens.

Does anyone know if it's explicitly documented anywhere which types of names are (meant to be) allowed for git refs? Note that you can create refs with names that don't actually work correctly; e.g.,

 sh$ git tag -- --foo
 sh$ git rev-parse --foo
 <failure>
- Gustav
Previous: Max KellermannNext: Max Kellermann
Message 2 of 3 in “commands.{new,rename}: verify patch names”
  1. commands.{new,rename}: verify patch namesMax Kellermann, Oct 5, 2010
  2. Gustav HållbergOct 5, 2010
  3. Max KellermannOct 5, 2010

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.