{"thread":{"id":"2594","subject":"[PATCH] Remove all old packfiles when doing \"git repack -a -d\"","startedAt":"2005-11-18T20:36:12Z","lastAt":"2005-11-18T21:15:35Z","messageCount":2,"participants":["Lukas Sandström","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"12247","messageId":"437E3B3C.9000409@etek.chalmers.se","threadId":"2594","inReplyTo":null,"subject":"[PATCH] Remove all old packfiles when doing \"git repack -a -d\"","fromName":"Lukas Sandström","fromEmail":"lukass@etek.chalmers.se","sentAt":"2005-11-18T20:36:12Z","receivedAt":"2005-11-18T20:36:12Z","isPatch":true,"sender":{"key":"luksan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/152281?v=4"},"body":"No point in running git-pack-redundant if we already know \nwhich packs are redundant.\n\nSigned-off-by: Lukas Sandström <lukass@etek.chalmers.se>\n---\nThis should be correct. I even tested it.\n\n\n git-repack.sh |   19 ++++++++++++++++---\n 1 files changed, 16 insertions(+), 3 deletions(-)\n\napplies-to: 8c987c24bed7f7a30f4e74b12e8acc2cc5eeea93\n2f49d2a3a7cf0fc64edfad2febf986252392b667\ndiff --git a/git-repack.sh b/git-repack.sh\nindex e58fdd6..55a7b27 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -63,9 +63,22 @@ exit\n if test \"$remove_redundant\" = t\n then\n \tsync\n-\tredundant=$(git-pack-redundant --all)\n-\tif test \"$redundant\" != \"\" ; then\n-\t\techo $redundant | xargs rm\n+\tif test \"$all_into_one\" = t\n+\tthen\n+\t\tcd \"$PACKDIR\"\n+\t\texisting=`find . -type f \\( -name '*.pack' -o -name '*.idx' \\) -print`\n+\t\tfor e in $existing\n+\t\tdo\n+\t\t\tcase \"$e\" in\n+\t\t\t./pack-$name.pack | ./pack-$name.idx) ;;\n+\t\t\t*)      rm -f $e ;;\n+\t\t\tesac\n+\t\tdone\n+\telse\n+\t\tredundant=$(git-pack-redundant --all)\n+\t\tif test \"$redundant\" != \"\" ; then\n+\t\t\techo $redundant | xargs rm\n+\t\tfi\n \tfi\n fi\n \n---\n0.99.9.GIT\n"},{"id":"12256","messageId":"7vek5dhd3c.fsf@assigned-by-dhcp.cox.net","threadId":"2594","inReplyTo":"437E3B3C.9000409@etek.chalmers.se","subject":"Re: [PATCH] Remove all old packfiles when doing \"git repack -a -d\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-18T21:15:35Z","receivedAt":"2005-11-18T21:15:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lukas Sandström <lukass@etek.chalmers.se> writes:\n\n> No point in running git-pack-redundant if we already know \n> which packs are redundant.\n>\n> Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>\n\nThis makes sense and makes me feel safer somehow.  Thanks.\n"}]}