Linus Torvalds <torvalds@xxxxxxxx> writes: > On Tue, 10 Oct 2006, Sam Vilain wrote: >> >> If using git-repack -a, unreferenced objects are kept behind in the >> pack. This might be the best default, but there are no good ways >> to clean up the packfiles if a lot of rebasing is happening, or >> branches have been deleted. > > Don't do this. > > I understand why you want to do it, but the fact is, it's dangerous. Sorry, I understand "it's dangerous" part, but I do not understand "why you want to do it" part. @@ -32,6 +33,11 @@ case ",$all_into_one," in ,,) rev_list='--unpacked' pack_objects='--incremental' + if [ -n "$prune" ] + then + # prune junk first + git-prune + fi ;; ,t,) rev_list= This shouldn't make any difference if the repository is quiescent (and is dangerous if it isn't). pack-objects will not get fed things that are not reachable. @@ -40,8 +46,14 @@ case ",$all_into_one," in # Redundancy check in all-into-one case is trivial. existing=`cd "$PACKDIR" && \ find . -type f \( -name '*.pack' -o -name '*.idx' \) -print` + + if [ -n "$prune" ] + then + rev_list=`cd "$GIT_DIR" && find refs -type f -print` + fi ;; esac + We give --all to rev-list so this should not have any effect either; other than that the code introduced by this hunk is broken with packed-refs. Isn't "repack -a -d" what Sam wants? - 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