Re: Find the starting point of a local branch
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 25, 2012, 01:09 UTC
- Message-ID
- <CACsJy8ChvEMt7FMs-zdyF9SOhL8U01x266OebEk3SHR+19908g@mail.gmail.com>
- In-Reply-To
- <7vbodjnu5c.fsf@alter.siamese.dyndns.org>
On Tue, Dec 25, 2012 at 2:10 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
>> I looked briefly at reflog before writing my previous mail and noticed
>> that when I create a new branch (usually using "git checkout -b branch
>> ref") it does not record the base commit.
>
> Hmph. Perhaps you are referring to something different than what I
> think "the base commit" with that word.
>
> $ git reflog mz/pick-unborn | tail -n 1
> b3cf6f3 mz/pick-unborn@{3}: branch: Created from ko/masterNo you're right. My reflogs must be pruned. Creating a new branch does produce that entry.
Show 13 quoted lines
>> We could at least invalidate the recorded base in reflog and let user >> define a new one (I hope). > > Please do not even think about going back and rewrite to lose > information. If the records have full information, you should be > able to reconstruct what you want from it without rewriting. > > Even more importantly, wish to "invalidate" indicates that you know > at a newer point that you have more authoritative information than > the older reflog entries, so you should be able to do the moral > equivalent by writing the event as establishing a new base at that > point (e.g. "checkout -B"), and stopping at that point in the reflog > when reading, without losing the older reflog entries.
Exactly. And when we prune the reflog, we could add the base back so the base is always in reflog.
-- Duy