Re: fetching packs and storing them as packs
- From
Junio C Hamano <junkio@cox.net>
- Date
- Oct 28, 2006, 19:15 UTC
- Message-ID
- <7vfyd88d6s.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20061028084001.GC14607@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
Show 8 quoted lines
> Shawn Pearce <spearce@spearce.org> wrote: >> 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?
Show 5 quoted lines
> + 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.
Show 18 quoted lines
> + 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.