git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git checkout --orphan skips reflogging
@ 2011-09-13 18:28 Dmitry Ivankov
  2011-09-13 23:04 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Ivankov @ 2011-09-13 18:28 UTC (permalink / raw)
  To: Git List

In short, git checkout --orphan doesn't write
HEAD_sha1 -> 00000
entry to logs/HEAD, while git-comit will write
00000 -> new_orphan_HEAD_sha1
entry. And then reflog backward walk will stop on 000 -> entry and
won't see earlier history.

How to reproduce:
$ git init test && cd test
$ git commit -m A --allow-empty
$ git checkout --orphan topic
$ git commit -m B --allow-empty
$ git log -g --oneline HEAD
some_sha1 HEAD@{0}: commit (initial): B
# oops, where are my old HEADs?
$ cat .git/logs/HEAD
000.. another_sha1 ... commit (initial): A
000.. some_sha1 ... commit (initial): B
# phew, at least I can find them by hand

Isn't  it also a bug in reflog walking that we rely on each old_sha1
being new_sha1 of a previous entry?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-14 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-13 18:28 git checkout --orphan skips reflogging Dmitry Ivankov
2011-09-13 23:04 ` Junio C Hamano
2011-09-14 11:55   ` Dmitry Ivankov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).