diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-03 13:38:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-03 13:38:01 -0700 |
commit | b2d46199d24856a05f455236031935dd35b3116f (patch) | |
tree | a001d1b98463edd11837b2881c0d1ac3616b8cf6 /git-repack-script | |
parent | 1c4a29120240a35b9c02afa636dac3e55ac96cb0 (diff) | |
download | git-b2d46199d24856a05f455236031935dd35b3116f.tar.gz git-b2d46199d24856a05f455236031935dd35b3116f.tar.xz |
Add "git repack" command that does an incremental pack
Diffstat (limited to 'git-repack-script')
-rw-r--r-- | git-repack-script | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/git-repack-script b/git-repack-script new file mode 100644 index 000000000..ce35235b5 --- /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/" |