Re: Nasty git corruption problem
From: Johannes Schindelin
Date: Thu Jul 27 2006 - 17:09:44 EST
Hi,
On Thu, 27 Jul 2006, Linus Torvalds wrote:
> On Thu, 27 Jul 2006, Johannes Schindelin wrote:
> >
> > On Thu, 27 Jul 2006, Linus Torvalds wrote:
> >
> > > On Thu, 27 Jul 2006, Alan Cox wrote:
> > > >
> > > > git-lost-found turns up some of the missing stuff that was applied
> > > > earliest in the rebase but the other stuff is apparently neither visible
> > > > anywhere in the tree or missing (the tree I was rebasing "^^^..." never
> > > > shows it nor does the log).
> > >
> > > Did you try "git-fsck-objects --full"?
> > >
> > > The git-lost-found script is apparently broken, exactly because it doesn't
> > > do a "full".
> >
> > Of course, I was assuming that nothing like repacking or pruning took
> > place after the crash...
>
> If somebody does a "git rebase", he might be changing the heads that have
> already been packed, and replacing them them with heads that have _not_
> yet been packed.
Okay, I see your point.
> That said, I still don't think Alan sees what he says he sees. Even if
> something crashes in the middle of a "git rebase", I think the old head
> should have been saved in .git/ORIG_HEAD, for example.
>
> That said, some of the more invasive operations (and "git rebase"
> certainly counts) should probably have a few "sync" operations to make
> sure that things like ORIG_HEAD really are on disk, so that we would be
> able to recreate the tree even _without_ anything like "git-fsck-objects".
Why not just the good ole' locking mechanism? Update not the HEAD
directly, but a HEAD.lock, and if all went well, rename it into HEAD (of
course, by HEAD I mean refs/heads/<whatever-head-you-mean>).
Ciao,
Dscho
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/