From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:11
Lukas Sandström [off-list ref] writes:
This is most likley because the pack b3c6... contains unreachable objects.
git-pack-redundant only makes sure that all objects present in packfiles
still are present in packfiles after the redundant packs have been removed.
...
I'm thinking of the possibility passing a list of objects to be ignored
on stdin to git-pack-redundant. This would hopefully solve this problem.
But once you go down that path, wouldn't doing 'repack -a -d'
become looking simpler and more attractive, I wonder?
This is most likley because the pack b3c6... contains unreachable objects.
git-pack-redundant only makes sure that all objects present in packfiles
still are present in packfiles after the redundant packs have been removed.
...
I'm thinking of the possibility passing a list of objects to be ignored
on stdin to git-pack-redundant. This would hopefully solve this problem.
But once you go down that path, wouldn't doing 'repack -a -d'
become looking simpler and more attractive, I wonder?
It depends on how expensive git-fsck-objects --full --unreacahble is versus
a full repack.
Howerver, if I read the source correctly git-fsck-objects doesn't currently test
the reachablility of packed objects. This would have to change, and I'm not certain
of how to do that properly.
Note that the following patch is reqired if git-repack -a -d is to work as expected.
(Remove all packs except the new one)
Btw, I'm sending this patch in utf8, let's see if it works...
----
Subject: [PATCH] Make sure all old packfiles are removed when doing a full repack
This is nessecary because unrachable objects in packfiles makes git-pack-redundant
flag them as non-redundant.
Signed-off-by: Lukas Sandström <redacted>
---
git-repack.sh | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
applies-to: 9a0f0c748316751fbf593a21f2b16bcdd975095a
08df1f641bd3f98a607a8413d647667adc18a633
On Sun, 13 Nov 2005 11:58:11 +0100 Lukas Sandstr__m wrote:
quoted hunk
Subject: [PATCH] Make sure all old packfiles are removed when doing a full repack
This is nessecary because unrachable objects in packfiles makes git-pack-redundant
flag them as non-redundant.
Signed-off-by: Lukas Sandstr____m <redacted>
---
git-repack.sh | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
applies-to: 9a0f0c748316751fbf593a21f2b16bcdd975095a
08df1f641bd3f98a607a8413d647667adc18a633
This should be
if test "$all_into_one$remove_redandant" = tt
(otherwise "git repack -a" becomes the same as "git repack -a -d").
+then
+ sync
+ ( cd "$PACKDIR" &&
+ for e in $existing
+ do
+ case "$e" in
+ ./pack-$name.pack | ./pack-$name.idx) ;;
+ *) rm -f $e ;;
+ esac
+ done
+ )
+else if test "$remove_redandant" = t
then
sync
redundant=$(git-pack-redundant --all)
---
0.99.9.GIT
On Sun, 13 Nov 2005 11:58:11 +0100 Lukas Sandström wrote:
quoted
Subject: [PATCH] Make sure all old packfiles are removed when doing a full repack
This is nessecary because unrachable objects in packfiles makes git-pack-redundant
flag them as non-redundant.
Signed-off-by: Lukas Sandström <redacted>
---
git-repack.sh | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
applies-to: 9a0f0c748316751fbf593a21f2b16bcdd975095a
08df1f641bd3f98a607a8413d647667adc18a633
On Sun, Nov 13, 2005 at 01:07:50PM +0100, Lukas Sandstr?m wrote:
Sergey Vlasov wrote:
quoted
On Sun, 13 Nov 2005 11:58:11 +0100 Lukas Sandstr?m wrote:
quoted
quoted
-if test "$remove_redandant" = t
+if test "$all_into_one" = t
This should be
if test "$all_into_one$remove_redandant" = tt
(otherwise "git repack -a" becomes the same as "git repack -a -d").
This was the behaviour before git-pack-redundant, I just restored it.
But the old code was:
if test "$remove_redandant" = t
then
# We know $existing are all redandant only when
# all-into-one is used.
if test "$all_into_one" != '' && test "$existing" != ''
then
sync
( cd "$PACKDIR" &&
for e in $existing
do
case "$e" in
./pack-$name.pack | ./pack-$name.idx) ;;
*) rm -f $e ;;
esac
done
)
fi
fi
So without the -d option nothing was removed, even with -a.
(And test "$existing" != '' might also be needed for some shells which
are confused by the empty list in the for statement.)
Someone else gets to decide if git repack -a implies "remove all old packs".
If there is a separate -d option for this, just using -a probably
should not remove anything.
On Sun, Nov 13, 2005 at 01:07:50PM +0100, Lukas Sandstr?m wrote:
quoted
Sergey Vlasov wrote:
quoted
On Sun, 13 Nov 2005 11:58:11 +0100 Lukas Sandstr?m wrote:
quoted
quoted
quoted
-if test "$remove_redandant" = t
+if test "$all_into_one" = t
This should be
if test "$all_into_one$remove_redandant" = tt
(otherwise "git repack -a" becomes the same as "git repack -a -d").
This was the behaviour before git-pack-redundant, I just restored it.
But the old code was:
if test "$remove_redandant" = t
then
# We know $existing are all redandant only when
# all-into-one is used.
if test "$all_into_one" != '' && test "$existing" != ''
then
sync
( cd "$PACKDIR" &&
for e in $existing
do
case "$e" in
./pack-$name.pack | ./pack-$name.idx) ;;
*) rm -f $e ;;
esac
done
)
fi
fi
So without the -d option nothing was removed, even with -a.
True. I forgot to look at the context around the changed lines...
Btw, remove_redundant is misspellt.
(And test "$existing" != '' might also be needed for some shells which
are confused by the empty list in the for statement.)
quoted
Someone else gets to decide if git repack -a implies "remove all old packs".
If there is a separate -d option for this, just using -a probably
should not remove anything.
True, but you will have trouble removing stale packfiles if they contain
unreachable objects unless you remove them when you create the -a pack.
Anyway, ignore the patch above.