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

Re: git checkout creates strange '(null)'-branch

From
Junio C Hamano <gitster@pobox.com>
Date
May 8, 2012, 15:09 UTC
Message-ID
<7vaa1izp3h.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4FA904C3.7070208@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 11 quoted lines
> Am 5/8/2012 13:24, schrieb Erik Faye-Lund:
>> +		git show-ref | !grep "(null)"
> ...
>> Now, doing this doesn't make my test above pass,
>
> It is unlikely to pass if you used this test script literally, because
>
>    $ !grep
>    !grep: command not found
>
> "!" is not an operator in a shell script. Insert a space.

Good eyes. Also wouldn't it be a bit pointless to grep for (null) in the first place? It comes only because a particular implementation of vsnprintf() happens to emit it when asked to turn a NULL pointer into a string, and on other platforms it is allowed to segfault.

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 12 in “git checkout creates strange '(null)'-branch”
  1. Erik Faye-LundMay 8, 2012
  2. Johannes SixtMay 8, 2012
  3. Erik Faye-LundMay 8, 2012
  4. Andreas SchwabMay 8, 2012
  5. Junio C HamanoMay 8, 2012
  6. Erik Faye-LundMay 10, 2012
  7. Junio C HamanoMay 10, 2012
  8. Junio C HamanoMay 8, 2012
  9. Junio C HamanoMay 8, 2012
  10. Junio C HamanoMay 8, 2012
  11. Erik Faye-LundMay 8, 2012
  12. Junio C HamanoMay 8, 2012

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.