From: Jeff King <peff@peff.net>
To: Mark Jason Dominus <mjd@plover.com>
Cc: git@vger.kernel.org
Subject: Re: BUG 1.7.9: git-update-ref strange behavior with ref with trailing newline
Date: Thu, 2 Feb 2012 17:32:50 -0500 [thread overview]
Message-ID: <20120202223250.GA28618@sigill.intra.peff.net> (raw)
In-Reply-To: <15093.1328220568@plover.com>
On Thu, Feb 02, 2012 at 05:09:28PM -0500, Mark Jason Dominus wrote:
> 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'
Is it trailing newlines, or is simply pointing to a ref that does not
exist? Because I believe we do not create a HEAD reflog entry in that
case, as we would have nothing to write in the "new sha1" field. I guess
we could write an entry that it went to "0{40}", though I'm not sure how
things like "git reflog show" would handle that. The logic is at the
very end of refs.c:create_symref if you want to experiment.
As far as the newlines go, I'm surprised we don't reject that. We should
probably run check_refname_format on the proposed contents of the
symbolic-ref.
-Peff
next prev parent reply other threads:[~2012-02-02 22:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 22:09 BUG 1.7.9: git-update-ref strange behavior with ref with trailing newline Mark Jason Dominus
2012-02-02 22:32 ` Jeff King [this message]
2012-02-04 8:11 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120202223250.GA28618@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=mjd@plover.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).