Re: fetching packs and storing them as packs
From: Junio C Hamano <hidden>
Date: 2016-08-11 20:32:23
Shawn Pearce [off-list ref] writes:
Shawn Pearce [off-list ref] wrote:quoted
Why not just use create a new flag file? Lets say that a pack X is NOT eligible to be repacked if "$GIT_DIR/objects/pack/pack-X.keep" exists.Here's the `git repack -a -d` portion of that. Thoughts?
+ args=--unpacked + active= + if test -d "$PACKDIR" + then + for p in `find "$PACKDIR" -type f -name '*.pack' -print`
This change to run 'find "$PACKDIR"' is fragile when your $GIT_OBJECT_DIRECTORY has $IFS in it; running "find ." after "cd" in a subprocess was done very much on purpose to avoid that issue. Please don't break it.
+ do + n=`basename "$p" .pack` + d=`dirname "$p"` + if test -e "$d/$n.keep" + then + : keep + else + args="$args --unpacked=$p" + active="$active $n" + fi + done + fi + if test "X$args" = X--unpacked + then + args='--unpacked --incremental' + fi ;; esac
I do not remember offhand what --incremental meant, but presumably this is for the very initial "repack" (PACKDIR did not exist or find loop did not find anything to repack) and the flag would not make a difference? Care to explain? Other than that, the overall structure seems quite sane.