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

BUG 1.7.9: git-update-ref strange behavior with ref with trailing newline

From
Mark Jason Dominus <mjd@plover.com>
Date
Feb 2, 2012, 22:09 UTC
Message-ID
<15093.1328220568@plover.com>

Here I use git symbolic-ref to update HEAD with a ref whose name contains trailing newlines:

        $ git symbolic-ref -m "this message does not appear" HEAD 'refs/heads/master
        >
        >
        > '

The newlines are inserted into .git/HEAD, but are innocuous, because other git commands ignore them. The bug is that the -m option is completely ignored:

        $ git reflog HEAD | grep 'message does not appear'
        $

If trailing newlines are considered acceptable, the -m option should be honored. If not, an error message should be printed and thecommand should exit with a nonzero exit status.

I will prepare a patch if you will say which behavior would be preferable.

Mark Jason Dominus 	  			                 mjd@plover.com
Next: Jeff King
Message 1 of 3 in “BUG 1.7.9: git-update-ref strange behavior with ref with trailing newline”
  1. Mark Jason DominusFeb 2, 2012
  2. Jeff KingFeb 2, 2012
  3. Junio C HamanoFeb 4, 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.