git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* grafts+repack+prune = history at danger
@ 2007-01-25 17:17 Johannes Sixt
  2007-01-25 23:07 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Johannes Sixt @ 2007-01-25 17:17 UTC (permalink / raw)
  To: git

Isn't there a major hole in the logic how repack works when grafts are
in effect?

I did this (details follow):

1. specify grafts
2. repack
3. prune
4. clone

Result: Broken history in the clone; info/grafts was not copied.
This is with git version 1.5.0.rc2.g18af.


1. I imported a cvs repository into git and "fixed" the history using
grafts. In particular:

      o--B--X   <== this commit is should be skipped
          \  \
graft =>   ---A--o

I specified in .git/info/grafts that the parent of A should be B. Of
course, commit A has still recorded X as its parent.

2. Then I repacked the repo. But this did not erase all objects:

$ git repack -a -d
$ git count-objects -v
count: 5
size: 28
in-pack: 3392
packs: 1
prune-packable: 0
garbage: 0
$ git fsck-objects
dangling commit bb828bfbd213a97817a95506bab4eeaa70538e2e

This commit bb828... is X.

3. Now git prune happily removes the 5 objects.

4. 'git clone First Second' clones the repository without problems.

But now in the clone the history is kaputt. Because commit X is not in
the cloned pack. Nor is there any info/grafts file. The original history
is still OK as long as the info/grafts file is present; but if it is
removed, the original repo is also damaged.

IMHO, this is a very serious issue. I think that repack should not walk
the grafted history. Alternatively, the info/grafts file must be copied
by the clone and respected by fsck-objects.

-- Hannes

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

end of thread, other threads:[~2007-01-27  0:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 17:17 grafts+repack+prune = history at danger Johannes Sixt
2007-01-25 23:07 ` Junio C Hamano
2007-01-26  8:13   ` Johannes Sixt
2007-01-26  8:54     ` Junio C Hamano
2007-01-26  9:21       ` Johannes Sixt
2007-01-26  9:31         ` Junio C Hamano
2007-01-26  9:48           ` Johannes Sixt
2007-01-26 10:15             ` Junio C Hamano
2007-01-26 10:41               ` Johannes Sixt
2007-01-26 11:29                 ` Junio C Hamano
2007-01-26 13:08         ` Jakub Narebski
2007-01-26 15:55       ` Linus Torvalds
2007-01-26 23:46         ` Junio C Hamano
2007-01-27  0:56           ` Linus Torvalds
2007-01-26  9:15   ` Mark Wooding

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).