summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c4a291)
raw | patch | inline | side by side (parent: 1c4a291)
author | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 20:38:01 +0000 (13:38 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 20:38:01 +0000 (13:38 -0700) |
Makefile | patch | blob | history | |
git-repack-script | [new file with mode: 0644] | patch | blob |
diff --git a/Makefile b/Makefile
index e86ba65805294353bb3500189a63f313dcfb3ed2..2590c817229d2274404457238d4c5bd9698c3221 100644 (file)
--- a/Makefile
+++ b/Makefile
git-fetch-script git-status-script git-commit-script \
git-log-script git-shortlog git-cvsimport-script git-diff-script \
git-reset-script git-add-script git-checkout-script git-clone-script \
- gitk git-cherry git-rebase-script git-relink-script
+ gitk git-cherry git-rebase-script git-relink-script git-repack-script
PROG= git-update-cache git-diff-files git-init-db git-write-tree \
git-read-tree git-commit-tree git-cat-file git-fsck-cache \
diff --git a/git-repack-script b/git-repack-script
--- /dev/null
+++ b/git-repack-script
@@ -0,0 +1,18 @@
+#!/bin/sh
+: ${GIT_DIR=.git}
+: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+packname=$(date +"pack-%s")
+if [ -f "$GIT_OBJECT_DIRECTORY/pack/$packname.idx" ]; then
+ echo Pack $packname already exists
+ exit 1
+fi
+rm -f $packname.idx $packname.pack
+git-rev-list --unpacked --objects $(git-rev-parse --all) |
+ git-pack-objects --non-empty --incremental $packname ||
+ exit 1
+
+if [ ! -f $packname.idx ]; then
+ echo Nothing new to pack
+ exit 0
+fi
+mv $packname.idx $packname.pack "$GIT_OBJECT_DIRECTORY/pack/"