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