Jeff King <peff <at> peff.net> writes:Here's what I was thinking (posted using gmane): diff --git a/git-repack.sh b/git-repack.sh index e18eb3f..064c331 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -30,7 +30,7 @@ do -n) no_update_info=t ;; -a) all_into_one=t ;; -A) all_into_one=t - keep_unreachable=--keep-unreachable ;; + keep_unreachable=t ;; -d) remove_redundant=t ;; -q) quiet=-q ;; -f) no_reuse=--no-reuse-object ;; @@ -78,9 +78,6 @@ case ",$all_into_one," in if test -z "$args" then args='--unpacked --incremental' - elif test -n "$keep_unreachable" - then - args="$args $keep_unreachable" fi ;; esac @@ -116,7 +113,15 @@ for name in $names ; do echo >&2 "old-pack-$name.{pack,idx} in $PACKDIR." exit 1 } - rm -f "$PACKDIR/old-pack-$name.pack" "$PACKDIR/old-pack-$name.idx" + rm -f "$PACKDIR/old-pack-$name.idx" + test -z "$keep_unreachable" || + ! test -f "$PACKDIR/old-pack-$name.pack" || + git unpack-objects < "$PACKDIR/old-pack-$name.pack" || { + echo >&2 "Failed unpacking unreachable objects from old pack" + echo >&2 "saved as old-pack-$name.pack in $PACKDIR." + exit 1 + } + rm -f "$PACKDIR/old-pack-$name.pack" done if test "$remove_redundant" = t @@ -130,7 +135,18 @@ then do case " $fullbases " in *" $e "*) ;; - *) rm -f "$e.pack" "$e.idx" "$e.keep" ;; + *) + rm -f "$e.idx" "$e.keep" + if test -n "$keep_unreachable" && + test -f "$e.pack" + then + git unpack-objects < "$e.pack" || { + echo >&2 "Fail AVOID GMANE WRAP" + exit 1 + } + fi + rm -f "$e.pack" + ;; esac done ) Is the first invocation of unpack-objects necessary? pack-objects has created a pack which hashes to the same name of a pack we already have, and we replace the original with the new one. Is that what is happening? They will be identical right? Of course this won't set the timestamp on the created objects based on the timestamp of the pack file, but this was easy. Setting the timestamp would be proper, but what's another two weeks. Besides, for those users not manually running git-gc, this code path won't even be executed until there are enough pack files for git-gc to add -A to the repack options. Then, for git-gc it should be enough to just always use -A with repack when manually running it. Then --prune can be deprecated. -brandon -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Andrew Morton | 2.6.22-rc6-mm1 |
| Avi Kivity | [PATCH 002/104] KVM: SMP: Add vcpu_id field in struct vcpu |
| Pavel Machek | Re: suspend2 merge (was Re: [Suspend2-devel] Re: CFS and suspend2: hang in atomic ... |
| Con Kolivas | Re: -mm merge plans for 2.6.23 |
git: | |
| Junio C Hamano | What's cooking in git.git (topics) |
| Pazu | qgit on Mac OS X |
| Junio C Hamano | Re: [PATCH] Deprecate git-lost-found |
| Steffen Prohaska | Re: CVS -> SVN -> Git |
| Richard Stallman | Real men don't attack straw men |
| Siju George | Dell Latitude D820 |
| Lars Noodén | Call for testing - uvideo(4) |
| peter | ntpd not synching |
| Stephen Pierce | SLS |
| Dave `geek' Gymer | WARNING (was Re: New afio release) |
| Theodore Ts'o | Re: Splitting comp.os.linux |
| Goetz Schuchart | Re: [?] df: cannot read table of mounted filesystems |
| magical mounts | 9 hours ago | Linux kernel |
| Problem in scim in Fedora 9 | 10 hours ago | Linux general |
| The new Western Digital power saving drives | 10 hours ago | Hardware |
| Battery Maximizer Software | 1 day ago | Linux kernel |
| windows folder creation surprise | 1 day ago | Windows |
| Firewall | 1 day ago | OpenBSD |
| IP layer send packet | 2 days ago | Linux kernel |
| dtrace for linux available | 2 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 3 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 3 days ago | NetBSD |
