Re: Truncating HEAD reflog on branch move
- From
Kyle Meyer <kyle@kyleam.com>
- Date
- Jun 21, 2017, 23:04 UTC
- Message-ID
- <87efud7xjd.fsf@kyleam.com>
- In-Reply-To
- <xmqqpodxm2t8.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 24 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
>> I get the following on 2.11.0:
>>
>> 2cbfbd5 HEAD@{0}:
>> 2cbfbd5 HEAD@{1}: checkout: moving from cPanel to master
>> eaf8db2 HEAD@{2}: checkout: moving from master to cPanel
>> 2cbfbd5 HEAD@{3}: clone: from https://bmc@git.crustytoothpaste.net/git/bmc/homedir.git
>>
>> and this on a recent next:
>>
>> 2cbfbd5 HEAD@{0}: Branch: renamed refs/heads/master to refs/heads/new
>>
>> For this test, any repo will work; I just picked this one because it had
>> two branches I could use to generate dummy reflog entries.
>>
>> A colleague reported this to me as a bug. I don't see anything in the
>> release notes about this as a desired behavior change, and it does seem
>> undesirable to truncate the reflog this way. If this isn't intentional,
>> I'm happy to work up a patch.
>
> I do not think either behaviour is intentional (old one that gives a
> meaningless empty entry probably is probably not what we want, the
> new one that truncates is not what we want, either).Eh, sorry about that. I haven't dug very deeply, but it seems like the entry is still in .git/logs/HEAD, while "git reflog" is only showing they latest entry. (Maybe because we stop consuming the entries when we hit a null sha1 in the old id field?)
-- Kyle