Skip to content

Commit 58bd77b

Browse files
pcloudsgitster
authored andcommitted
pack-objects: validation and documentation about unreachable options
These options are added in [1] [2] [3]. All these depend on running rev-list internally which is normally true since they are always used with "--all --objects" which implies --revs. But let's keep this dependency explicit. While at there, add documentation for them. These are mostly used internally by git-repack. But it's still good to not chase down the right commit message to know how they work. [1] ca11b21 (let pack-objects do the writing of unreachable objects as loose objects - 2008-05-14) [2] 08cdfb1 (pack-objects --keep-unreachable - 2007-09-16) [3] e26a8c4 (repack: extend --keep-unreachable to loose objects - 2016-06-13) Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 468165c commit 58bd77b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Documentation/git-pack-objects.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,19 @@ Unexpected missing object will raise an error.
267267
locally created objects [without .promisor] and objects from the
268268
promisor remote [with .promisor].) This is used with partial clone.
269269

270+
--keep-unreachable::
271+
Objects unreachable from the refs in packs named with
272+
--unpacked= option are added to the resulting pack, in
273+
addition to the reachable objects that are not in packs marked
274+
with *.keep files. This implies `--revs`.
275+
276+
--pack-loose-unreachable::
277+
Pack unreachable loose objects (and their loose counterparts
278+
removed). This implies `--revs`.
279+
280+
--unpack-unreachable::
281+
Keep unreachable objects in loose form. This implies `--revs`.
282+
270283
SEE ALSO
271284
--------
272285
linkgit:git-rev-list[1]

builtin/pack-objects.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,6 +3087,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
30873087
fetch_if_missing = 0;
30883088
argv_array_push(&rp, "--exclude-promisor-objects");
30893089
}
3090+
if (unpack_unreachable || keep_unreachable || pack_loose_unreachable)
3091+
use_internal_rev_list = 1;
30903092

30913093
if (!reuse_object)
30923094
reuse_delta = 0;

0 commit comments

Comments
 (0)