{"thread":{"id":"48414","subject":"[PATCH] pack-objects: validation and documentation about unreachable options","startedAt":"2018-05-05T08:47:43Z","lastAt":"2018-05-05T18:11:15Z","messageCount":2,"participants":["Nguyễn Thái Ngọc Duy","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"346712","messageId":"20180505084716.2345-1-pclouds@gmail.com","threadId":"48414","inReplyTo":null,"subject":"[PATCH] pack-objects: validation and documentation about unreachable options","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-05-05T08:47:16Z","receivedAt":"2018-05-05T08:47:43Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"These options are added in [1] [2] [3]. All these depend on running\nrev-list internally which is normally true since they are always used\nwith \"--all --objects\" which implies --revs. But let's keep this\ndependency explicit.\n\nWhile at there, add documentation for them. These are mostly used\ninternally by git-repack. But it's still good to not chase down the\nright commit message to know how they work.\n\n[1] ca11b212eb (let pack-objects do the writing of unreachable objects\n    as loose objects - 2008-05-14)\n[2] 08cdfb1337 (pack-objects --keep-unreachable - 2007-09-16)\n[3] e26a8c4721 (repack: extend --keep-unreachable to loose objects -\n    2016-06-13)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/git-pack-objects.txt | 13 +++++++++++++\n builtin/pack-objects.c             |  2 ++\n 2 files changed, 15 insertions(+)\n\ndiff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt\nindex 81bc490ac5..44245e5815 100644\n--- a/Documentation/git-pack-objects.txt\n+++ b/Documentation/git-pack-objects.txt\n@@ -267,6 +267,19 @@ Unexpected missing object will raise an error.\n \tlocally created objects [without .promisor] and objects from the\n \tpromisor remote [with .promisor].)  This is used with partial clone.\n \n+--keep-unreachable::\n+\tObjects unreachable from the refs in packs named with\n+\t--unpacked= option are added to the resulting pack, in\n+\taddition to the reachable objects that are not in packs marked\n+\twith *.keep files. This implies `--revs`.\n+\n+--pack-loose-unreachable::\n+\tPack unreachable loose objects (and their loose counterparts\n+\tremoved). This implies `--revs`.\n+\n+--unpack-unreachable::\n+\tKeep unreachable objects in loose form. This implies `--revs`.\n+\n SEE ALSO\n --------\n linkgit:git-rev-list[1]\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 4bdae5a1d8..cfac021360 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3085,6 +3085,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\tfetch_if_missing = 0;\n \t\targv_array_push(&rp, \"--exclude-promisor-objects\");\n \t}\n+\tif (unpack_unreachable || keep_unreachable || pack_loose_unreachable)\n+\t\tuse_internal_rev_list = 1;\n \n \tif (!reuse_object)\n \t\treuse_delta = 0;\n-- \n2.17.0.705.g3525833791\n\n"},{"id":"346722","messageId":"20180505181109.GA17700@sigill.intra.peff.net","threadId":"48414","inReplyTo":"20180505084716.2345-1-pclouds@gmail.com","subject":"Re: [PATCH] pack-objects: validation and documentation about unreachable options","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-05T18:11:10Z","receivedAt":"2018-05-05T18:11:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 05, 2018 at 10:47:16AM +0200, Nguyễn Thái Ngọc Duy wrote:\n\n> These options are added in [1] [2] [3]. All these depend on running\n> rev-list internally which is normally true since they are always used\n> with \"--all --objects\" which implies --revs. But let's keep this\n> dependency explicit.\n> \n> While at there, add documentation for them. These are mostly used\n> internally by git-repack. But it's still good to not chase down the\n> right commit message to know how they work.\n\nYeah, this all make sense to me. Thanks for documenting this.\n\n-Peff\n"}]}