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

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

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 21, 2010, 21:09 UTC
Message-ID
<AANLkTino4Dz_nMSV_4HHKD3K185t7spE22d5chLdo960@mail.gmail.com>
In-Reply-To
<7vd3vkgl0y.fsf@alter.siamese.dyndns.org>
On Mon, Jun 21, 2010 at 20:58, Junio C Hamano <gitster@pobox.com> wrote:
> Cluttering the output without protecting it with "advice" does not look
> like a "fix" nor improvement.

The short version of the message would also need to be fixed then, to do that properly would require bigger changes in the return code of bad_ref_char and the functions that call it. Then we could have e.g.:

    $ git checkout -b "I LOVE YOU"
    fatal: git checkout: Branch name cannot contain ' ';  marked by
<-- HERE in 'I ' <-- HERE
Similar to what you get from:
    $ perl -e '/I LOVE [/'

That would also make the long version unnecessary, and maybe improve some other error messages that deal with ref names.

Previous: Junio C Hamano
Message 3 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.