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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]