Migrate git-repack.sh to use git-rev-parse --parseopt
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pierre Habouzit committed
Nov 4, 2007 at 11:31 UTC
5715d0bb60dd90b03519cc436310f3cabe5b9b2a
1 file changed
+19
-5
git-repack.sh
+19
-5
@@ -3,7 +3,22 @@
3
# Copyright (c) 2005 Linus Torvalds
4
#
5
6
-USAGE='[-a|-A] [-d] [-f] [-l] [-n] [-q] [--max-pack-size=N] [--window=N] [--window-memory=N] [--depth=N]'
6
+OPTIONS_KEEPDASHDASH=
7
+OPTIONS_SPEC="\
8
+git-repack [options]
9
+--
10
+a pack everything in a single pack
11
+A same as -a, and keep unreachable objects too
12
+d remove redundant packs, and run git-prune-packed
13
+f pass --no-reuse-delta to git-pack-objects
14
+q,quiet be quiet
15
+l pass --local to git-pack-objects
16
+ Packing constraints
17
+window= size of the window used for delta compression
18
+window-memory= same as the above, but limit memory size instead of entries count
19
+depth= limits the maximum delta depth
20
+max-pack-size= maximum size of each packfile
21
+"
22
SUBDIRECTORY_OK='Yes'
23
. git-sh-setup
24
@@ -20,10 +35,9 @@ do
35
-q) quiet=-q ;;
36
-f) no_reuse=--no-reuse-object ;;
37
-l) local=--local ;;
23
- --max-pack-size=*) extra="$extra $1" ;;
24
- --window=*) extra="$extra $1" ;;
25
- --window-memory=*) extra="$extra $1" ;;
26
- --depth=*) extra="$extra $1" ;;
38
+ --max-pack-size|--window|--window-memory|--depth)
39
+ extra="$extra $1=$2"; shift ;;
40
+ --) shift; break;;
41
*) usage ;;
42
esac
43
shift