login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Brian Gernhardt <benji@...>
Cc: Git List <git@...>
Date: Monday, July 7, 2008 - 2:28 am

Brian Gernhardt <benji@silverinsanity.com> writes:


The idea behind ORIG_HEAD is to have an anchoring point before an
operation that moves your HEAD in a drastic way.  Think if it as a
poor-man's reflog -- in fact it predates reflog.

That is why reset saves away the HEAD before it does its thing, so that
you can easily say "Oops, I did not mean it -- reset ORIG_HEAD" to flip
back to the previous state.  Both a fast-forward merge and a real merge
can be undone by resetting back to ORIG_HEAD.

So in that sense:

 (1) ORIG_HEAD is not strictly necessary these days, because we have
     reflogs;

 (2) Even then, it is handy and useful, and we could add ORIG_HEAD to more
     commands such as "git am" and "git rebase".

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [FIXED PATCH] Make rebase save ORIG_HEAD if changing cur..., Junio C Hamano, (Mon Jul 7, 2:28 am)
speck-geostationary