@matheusbsbs / matheus-bagliano / commits / cec2be76d9
Fork 0

git-repack: allow passing a couple of flags to pack-objects.

A new flag -q makes underlying pack-objects less chatty. A new flag -f forces delta to be recomputed from scratch. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 16, 2006 at 11:57 UTC cec2be76d9789b11c7f955b62dcad4b1050202af
2 files changed +16 -7
Documentation/git-repack.txt
+9 -1
@@ -9,7 +9,7 @@ objects into pack files.
9
10 SYNOPSIS
11 --------
12 -'git-repack' [-a] [-d] [-l] [-n]
12 +'git-repack' [-a] [-d] [-f] [-l] [-n] [-q]
13
14 DESCRIPTION
15 -----------
@@ -43,6 +43,14 @@ OPTIONS
43 Pass the `--local` option to `git pack-objects`, see
44 gitlink:git-pack-objects[1].
45
46 +-f::
47 + Pass the `--no-reuse-delta` option to `git pack-objects`, see
48 + gitlink:git-pack-objects[1].
49 +
50 +-q::
51 + Pass the `-q` option to `git pack-objects`, see
52 + gitlink:git-pack-objects[1].
53 +
54 -n::
55 Do not update the server information with
56 `git update-server-info`.
git-repack.sh
+7 -6
@@ -3,17 +3,20 @@
3 # Copyright (c) 2005 Linus Torvalds
4 #
5
6 -USAGE='[-a] [-d] [-l] [-n]'
6 +USAGE='[-a] [-d] [-f] [-l] [-n] [-q]'
7 . git-sh-setup
8
9 -no_update_info= all_into_one= remove_redundant= local=
9 +no_update_info= all_into_one= remove_redundant=
10 +local= quiet= no_reuse_delta=
11 while case "$#" in 0) break ;; esac
12 do
13 case "$1" in
14 -n) no_update_info=t ;;
15 -a) all_into_one=t ;;
16 -d) remove_redundant=t ;;
16 - -l) local=t ;;
17 + -q) quiet=-q ;;
18 + -f) no_reuse_delta=--no-reuse-delta ;;
19 + -l) local=--local ;;
20 *) usage ;;
21 esac
22 shift
@@ -39,9 +42,7 @@ case ",$all_into_one," in
42 find . -type f \( -name '*.pack' -o -name '*.idx' \) -print`
43 ;;
44 esac
42 -if [ "$local" ]; then
43 - pack_objects="$pack_objects --local"
44 -fi
45 +pack_objects="$pack_objects $local $quiet $no_reuse_delta"
46 name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) 2>&1 |
47 git-pack-objects --non-empty $pack_objects .tmp-pack) ||
48 exit 1