Junio C Hamano wrote:
Andreas Ericsson <ae@xxxxxx> writes:
However, just now I made a doodoo and need to recover a lost branch-head,
so git lost-found to the rescue. Or so I thought... It turns out that since
I've packed the unreachable refs, they haven't been pruned, and I can't
for the life of me figure out how to get rid of them.
Sorry, I am a bit lost on what you are trying to achieve here.
Are you trying to find the lost tip, or are you trying to remove
objects that are only reachable from that lost tip?
Originally I was trying to find the lost tip, which was made impossible due to
the extremely large number of loose branch-tips git-lost-found reported.
I thought lost-found was modified not to take reflogs into
account specifically to support the former usage.
Yes, but since reflogs *are* taken into account when pruning lost tips,
lost-found reported 594 revisions.
In a last-ditch desperate effort, I tried with git-unpack-objects as well,
but it seems broken as it fails to create the loose objects under
.git/objects/[0-f0-f]/. I'll look into that tonight if I get some spare time.
Don't look into that -- unpack-objects won't explode objects
that are already available in the repository. It is not "it
fails" but "it was designed not to".
So how does one unpack a packfile to extract the loose objects?
mv .git/objects/pack/*.pack /tmp/git-packs
for p in /tmp/git-packs/*.pack; do git unpack-objects < $p; done
?
Seems like an awful lot of trouble. I'll look into patching
builtin-pack-objects.c instead to accept an "--ignore-reflog" flag and prune
reflog-accessible objects. Will that break anything fundamental? To me, the
ability to say "HEAD@{35}" (or "HEAD@{650}"...) is not fundamental, and I
don't know any scripts that rely on it for their operations.
--
Andreas Ericsson andreas.ericsson@xxxxxx
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html