Open pv opened 11 years ago
+1, I'm also getting this.
That sounds really bad :-/.
BTW, you mention that it also affects git-remote-hg from git.git/contrib -- you may wish to inform its author about this issue, too (e.g. by filing a report here: https://github.com/felipec/git/issues)
I can reliably reproduce this issue with a local clone of the pygments repository (which is much smaller than the pypy repository, which is helpful). This does it:
hg clone http://bitbucket.org/birkenfeld/pygments-main
git clone hg::pygments-main pygments.git
cp -r pygments.git pygments.git.bak # makes it easier to debug the issue
cd pygments.git
git reflog expire --expire=0 --all
git prune
git repack -f -a -d
git gc --prune=0
After this, if I do a pull (even without any remote changes, I get an error like this:
$ git pull
fatal: object not found: 21a43f1a47819533ebc1144382316104f460cf77
fast-import: dumping crash report to .git/fast_import_crash_13549
fatal: Error while running fast-import
Going to the backup copy of the clone I made, it is easy to find out what the missing object is:
$ git show --notes=hg* 21a43f1a47819533ebc1144382316104f460cf77
commit 21a43f1a47819533ebc1144382316104f460cf77
Author: Georg Brandl <georg@python.org>
Date: 2010-09-12 19:47:49 +0200
Close inactive branch.
Notes (hg):
ab1b6651b3c730c5e36dd90f6835926cf8ecbb1d
Aha! So the fact that we don't create refs for those branches is causing the commits on them to be garbage collected. BTW, for reference, here is how the above commit look on the Mercurial side:
$ hg show ab1b6651b3c730c5e36dd90f6835926cf8ecbb1d
changeset: 1080:ab1b6651b3c7
branch: perl-CHECK-INIT-block-highlighting
parent: 1024:ef8e4ba205d6
user: Georg Brandl <georg@python.org>
date: Sun Sep 12 19:47:49 2010 +0200
description:
Close inactive branch.
Now, one fix for this would be add refs for all closed branches (kind of ugly, though). But even with this, we'd run into an issue if a mercurial branch has multiple heads...
Hi,
Running the following causes problems:
After a few days when the repo got some updates:
The same issue occurs with
git-remote-hg
from git/git/contrb, btw.Due to dropping anonymous heads? I'd guess the same issue will come about even without running the gc if you wait a couple of months so that git auto-expires unreachable commits?