From: Jeff King Date: Fri, 29 Apr 2011 22:48:30 GMT Subject: Re: git symbolic-ref vs. reflog (vs. rebase) Message-ID: <20110429224829.GC3434@sigill.intra.peff.net> In-Reply-To: <7vk4edyqqn.fsf@alter.siamese.dyndns.org> On Fri, Apr 29, 2011 at 09:19:44AM -0700, Junio C Hamano wrote: > Csaba Henk writes: > > > "git symbolic-ref" is a dangerous command in the sense that it can > > change your HEAD position without updating the reflog. Is it > > intended behaviour? > > Yes, it is. But you can choose to do: > > $ git branch side > $ git symoblic-ref -m "move to side" HEAD refs/heads/side > $ git log --oneline -g HEAD@{0} > 05ddb9b HEAD@{0}: move to side > e69de29 HEAD@{1}: commit (initial): first commit > > if you wanted to. I think every caller should be using "-m" these days. I know we can't _require_ it for historical reasons. But shouldn't symbolic-ref always write a reflog entry? Even something like "we changed and I can't tell you why" to cover older scripts that call symbolic-ref? -Peff