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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brian Gernhardt <benji@xxxxxxxxxxxxxxxxxx> writes:

> My final thought is that the rational ORIG_HEAD and when we set it is
> not clearly documented anywhere.  But I am currently out of time to
> work on git, so that patch won't be coming from me soon.

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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux