1 Usage: list_packs [-C <dir>] [option ...] ( --only <file> | <directory> )
3 -C <dir> change current working director to <dir> before anything
4 --quiet no error messages but exit code still set
5 --all inspect all *.pack instead of just pack-<sha1>.pack
6 --exclude-keep exclude any matching packs with associated .keep
7 --exclude-no-keep exclude any matching packs without associated .keep
8 --exclude-bitmap exclude any matching packs with associated .bitmap
9 --exclude-no-bitmap exclude any matching packs without associated .bitmap
10 --exclude-bndl exclude any matching packs with associated .bndl
11 --exclude-no-bndl exclude any matching packs without associated .bndl
12 --exclude-idx exclude any matching packs with associated .idx
13 --exclude-no-idx exclude any matching packs without associated .idx
14 --exclude-limit <n> exclude any matching packs with at least n objects
15 if n is < 0 then exclude packs without at least -n objs
16 --count instead of pack files output a count of them
17 --count-objects instead of pack files output a total object count
19 --only <file> inspect only packs named in <file> (use - for stdin)
20 <directory> inspect only .pack files in here (see the --all option)
22 If multiple -C options are given they are processed in the order given and
23 they are always processed before attempting to open <directory> or <file>.
25 If a <directory> is given then the --only option may NOT be used.
27 If the --only option is used then neither --all nor <directory> may be used.
29 If both --count and --count-objects are given, the last one wins.
31 If both --exclude-xxx and --exclude-no-xxx are given, then the last one wins.
33 If neither --exclude-xxx nor --exclude-no-xxx is given, then packs both with
34 AND without an associated .xxx file match.
36 For --only, pack names are relative to the current directory (but see the -C
37 option) and MUST include the trailing .pack and MUST be one per line but
38 any characters after and including the first whitespace or colon character
39 are ignored on each line. Empty lines and lines with the first char
40 whitespace or ':' are ignored.
42 The --only option will properly read a fast-import --export-pack-edges file.
44 If an error (other than EOF) occurs while reading the --only file, an error
45 message will be output (unless the --quiet option is used) and the exit
46 status will be non-zero.
48 Output is one pack file name (including the .pack suffix) per line unless
49 the --count or --count-objects option is used in which case it's a single
50 decimal count of either the number of pack file names that would have been
51 output (--count) or the total count of all the objects in all the pack
52 files that would have been included in the output (--count-objects).
54 Using the --only option allows files not ending in .pack to be inspected in
55 which case the --exclude-[no-]xxx options may not work as intended (since
56 when there is no .pack suffix to remove they will just append the test
57 suffix without first removing anything).
59 The --exclude-no-idx option not only checks for the existence of an
60 associated .idx file, it also verifies the length is at least
61 1072 + 28 * number of objects in the corresponding .pack file. However,
62 it does NOT validate the actual .idx file contents in any way (i.e.
63 no signature check nor matching object count check).
65 If an otherwise matching .pack file fails the header sanity check test (it
66 must have a PACK signature, a version of 2 or 3 and a length of at least
67 32 + number of objects) or, when --exclude-no-idx is used and the
68 associated .idx file fails the length check, a message is output to stderr
69 unless the --quiet option is used. Using --exclude-no-idx does NOT produce
70 any error message when there is no associated .idx file, the .pack is just
73 If a file being checked is not actually a file (i.e. a directory or other
74 non-file), an error message will be output unless the --quiet option is
75 used. However, operation then continues as though the non-file did not