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

Re: [PATCH] checkout: Better error message on invalid branch name

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 21, 2010, 20:58 UTC
Message-ID
<7vd3vkgl0y.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1277146419-19507-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 20 quoted lines
> Change the error message for `git checkout -b "I LOVE YOU"' and other
> invalid branch names to say what branch names are invalid, rather than
> just saying we don't like it.
>
> Before:
>
>     $ git checkout -b "I LOVE YOU"
>     fatal: git checkout: we do not like 'I LOVE YOU' as a branch name.
>
> After:
>
>     $ git checkout -b "I LOVE YOU"
>     fatal: git checkout: The name "I LOVE YOU" is not a valid Git branch name.
>     A branch name can not:
>         - Have a path component that begins with "."
>         - Have a double dot ".."
>         - Have an ASCII control character, "~", "^", ":" or SP, anywhere
>         - End with a "/"
>         - End with ".lock"
>         - Contain a "\" (backslash

Cluttering the output without protecting it with "advice" does not look like a "fix" nor improvement.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 3 in “checkout: Better error message on invalid branch name”
  1. checkout: Better error message on invalid branch nameÆvar Arnfjörð Bjarmason, Jun 21, 2010
  2. Junio C HamanoJun 21, 2010
  3. Ævar Arnfjörð BjarmasonJun 21, 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.