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

Re: git symbolic-ref vs. reflog (vs. rebase)

From
Jeff King <peff@peff.net>
Date
Apr 29, 2011, 22:48 UTC
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:
Show 15 quoted lines
> Csaba Henk <csaba@lowlife.hu> 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
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 11 in “git symbolic-ref vs. reflog (vs. rebase)”
  1. Csaba HenkApr 29, 2011
  2. Junio C HamanoApr 29, 2011
  3. Csaba HenkApr 29, 2011
  4. Jeff KingApr 30, 2011
  5. Csaba HenkMay 2, 2011
  6. 1/2 rebase: create HEAD reflog entry when abortingJeff King, May 27, 2011
  7. 2/2 rebase: write a reflog entry when finishingJeff King, May 27, 2011
  8. Jeff KingApr 29, 2011
  9. Junio C HamanoApr 29, 2011
  10. Jeff KingApr 30, 2011
  11. Csaba HenkMay 2, 2011

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.