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

Re: [FIXED PATCH] Make rebase save ORIG_HEAD if changing current branch

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Jul 8, 2008, 14:32 UTC
Message-ID
<D66F511D-CDBE-4261-AA28-07ED73F6C593@silverinsanity.com>
In-Reply-To
<20080708042607.GC7186@sigill.intra.peff.net>
On Jul 8, 2008, at 12:26 AM, Jeff King wrote:
Show 22 quoted lines
> On Mon, Jul 07, 2008 at 11:03:46AM -0400, Brian Gernhardt wrote:
>
>> I personally expected @{1} to be identical to HEAD@{1}.  Since  
>> omitting a
>> ref usually refers to HEAD, why shouldn't omitting it when  
>> referring to
>> the reflogs mean the HEAD log?  The definition of @{1} is useful  
>> since
>> there's no other easy way to get "current branch's reflog", but I  
>> think
>> it's non-obvious.  (Since HEAD@{1} is something completely  
>> different, I
>> think the only other way to refer to @{1} is $(git symbolic- 
>> ref)@{1}.)
>
> FYI, there was much discussion about this exact point:
>
>  http://thread.gmane.org/gmane.comp.version-control.git/38379
>
> (I don't know that it has that much bearing on the current discussion,
> but since I went to the trouble of digging it up, I thought you might
> find it useful).

Oh, it is useful. And, thinking about it, I agree completely. The syntax isn't immediately obvious, but clear and useful. The need to distinguish between HEAD@{} and $branch@{} is apparent after a moment's reflection, and the chosen solution is fairly obvious at that point. I just never took that moment in my day-to-day working with git.

There's even documentation for it that is clear and understandable. If I was a new user to git, I would have read the documentation and found it. Having used git for a while, I don't bother to look things up and instead try to alter git to match my three years of experience. ;-)

That said, I still want clear and consistent semantics for ORIG_HEAD. And since that now (IMNSHO) exists in next, I'm happy.

~~ Brian
Previous: Jeff KingNext: Brian Gernhardt
Message 11 of 28 in “Make rebase save ORIG_HEAD if changing current branch”
  1. Make rebase save ORIG_HEAD if changing current branchBrian Gernhardt, Jul 6, 2008
  2. Junio C HamanoJul 7, 2008
  3. Brian GernhardtJul 7, 2008
  4. Junio C HamanoJul 7, 2008
  5. Junio C HamanoJul 7, 2008
  6. Junio C HamanoJul 7, 2008
  7. Theodore TsoJul 7, 2008
  8. Jakub NarebskiJul 7, 2008
  9. Brian GernhardtJul 7, 2008
  10. Jeff KingJul 8, 2008
  11. Brian GernhardtJul 8, 2008
  12. Brian GernhardtJul 7, 2008
  13. Junio C HamanoJul 7, 2008
  14. Junio C HamanoJul 7, 2008
  15. Jakub NarebskiJul 7, 2008
  16. Junio C HamanoJul 7, 2008
  17. Jakub NarebskiJul 7, 2008
  18. Brian GernhardtJul 8, 2008
  19. Documentation: mention ORIG_HEAD in am, merge, and rebaseBrian Gernhardt, Jul 8, 2008
  20. Junio C HamanoJul 8, 2008
  21. Brian GernhardtJul 8, 2008
  22. Jay SoffianJul 8, 2008
  23. Mike HommeyJul 7, 2008
  24. Junio C HamanoJul 7, 2008
  25. Mike HommeyJul 7, 2008
  26. Nanako ShiraishiJul 7, 2008
  27. Re* [FIXED PATCH] Make rebase save ORIG_HEAD if changing current branchJunio C Hamano, Jul 7, 2008
  28. Brian GernhardtJul 7, 2008

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.