{"thread":{"id":"54004","subject":"gc docs: git gc --keep-base-pack ?","startedAt":"2020-08-06T21:49:34Z","lastAt":"2020-11-23T10:18:34Z","messageCount":5,"participants":["Luc Van Oostenryck","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"403100","messageId":"20200806214929.22qgjg3o2noosjuo@ltop.local","threadId":"54004","inReplyTo":null,"subject":"gc docs: git gc --keep-base-pack ?","fromName":"Luc Van Oostenryck","fromEmail":"luc.vanoostenryck@gmail.com","sentAt":"2020-08-06T21:49:29Z","receivedAt":"2020-08-06T21:49:34Z","isPatch":false,"sender":{"key":"luc.vanoostenryck@gmail.com","avatar":"https://avatars.githubusercontent.com/u/16168334?v=4"},"body":"Hi,\n\nIn git-gc.1, in the part describing gc.bigPackThreshold\nthere is two references to an option '--keep-base-pack'\nbut there is no such option (and it doesn't seem to\ncorrespond to '--keep-largest-pack').\n\nRegards,\n-- Luc\n"},{"id":"410414","messageId":"20201120115522.23617-1-avarab@gmail.com","threadId":"54004","inReplyTo":"20200806214929.22qgjg3o2noosjuo@ltop.local","subject":"[PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2020-11-20T11:55:21Z","receivedAt":"2020-11-20T11:55:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The --keep-base-pack option never existed in git.git. It was the name\nfor the --keep-largest-pack option in earlier revisions of that series\nbefore it landed as ae4e89e549 (\"gc: add --keep-largest-pack option\",\n2018-04-15).\n\nThe later patches in that series[1][2] weren't changed to also refer\nto --keep-largest-pack, so we've had this reference to a nonexisting\noption ever since the feature initially landed.\n\n1. 55dfe13df9 (\"gc: add gc.bigPackThreshold config\", 2018-04-15)\n\n2. 9806f5a7bf (\"gc --auto: exclude base pack if not enough mem to\n   \"repack -ad\"\", 2018-04-15)\n\nReported-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Documentation/config/gc.txt | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt\nindex 00ea0a678e..c834e07991 100644\n--- a/Documentation/config/gc.txt\n+++ b/Documentation/config/gc.txt\n@@ -44,9 +44,9 @@ gc.autoDetach::\n \n gc.bigPackThreshold::\n \tIf non-zero, all packs larger than this limit are kept when\n-\t`git gc` is run. This is very similar to `--keep-base-pack`\n+\t`git gc` is run. This is very similar to `--keep-largest-pack`\n \texcept that all packs that meet the threshold are kept, not\n-\tjust the base pack. Defaults to zero. Common unit suffixes of\n+\tjust the largest pack. Defaults to zero. Common unit suffixes of\n \t'k', 'm', or 'g' are supported.\n +\n Note that if the number of kept packs is more than gc.autoPackLimit,\n@@ -57,7 +57,7 @@ gc.autoPackLimit and gc.bigPackThreshold should be respected again.\n If the amount of memory estimated for `git repack` to run smoothly is\n not available and `gc.bigPackThreshold` is not set, the largest pack\n will also be excluded (this is the equivalent of running `git gc` with\n-`--keep-base-pack`).\n+`--keep-largest-pack`).\n \n gc.writeCommitGraph::\n \tIf true, then gc will rewrite the commit-graph file when\n-- \n2.29.2.222.g5d2a92d10f8\n\n"},{"id":"410415","messageId":"20201120115522.23617-2-avarab@gmail.com","threadId":"54004","inReplyTo":"20200806214929.22qgjg3o2noosjuo@ltop.local","subject":"[PATCH 2/2] gc: rename keep_base_pack variable for --keep-largest-pack","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2020-11-20T11:55:22Z","receivedAt":"2020-11-20T11:55:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"As noted in an earlier change the keep_base_pack variable name is a\nrelic from an earlier on-list version of ae4e89e549 (\"gc: add\n--keep-largest-pack option\", 2018-04-15) before it was renamed to\n--keep-largest-pack.\n\nLet's change the variable name to avoid that confusion, it's easier to\nread the code if there's a 1=1 mapping between the variable name and\noption name.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/gc.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 5cd2a43f9f..07c15e4b64 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -533,7 +533,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \tconst char *name;\n \tpid_t pid;\n \tint daemonized = 0;\n-\tint keep_base_pack = -1;\n+\tint keep_largest_pack = -1;\n \ttimestamp_t dummy;\n \n \tstruct option builtin_gc_options[] = {\n@@ -547,7 +547,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\tOPT_BOOL_F(0, \"force\", &force,\n \t\t\t   N_(\"force running gc even if there may be another gc running\"),\n \t\t\t   PARSE_OPT_NOCOMPLETE),\n-\t\tOPT_BOOL(0, \"keep-largest-pack\", &keep_base_pack,\n+\t\tOPT_BOOL(0, \"keep-largest-pack\", &keep_largest_pack,\n \t\t\t N_(\"repack all other packs except the largest pack\")),\n \t\tOPT_END()\n \t};\n@@ -624,8 +624,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t} else {\n \t\tstruct string_list keep_pack = STRING_LIST_INIT_NODUP;\n \n-\t\tif (keep_base_pack != -1) {\n-\t\t\tif (keep_base_pack)\n+\t\tif (keep_largest_pack != -1) {\n+\t\t\tif (keep_largest_pack)\n \t\t\t\tfind_base_packs(&keep_pack, 0);\n \t\t} else if (big_pack_threshold) {\n \t\t\tfind_base_packs(&keep_pack, big_pack_threshold);\n-- \n2.29.2.222.g5d2a92d10f8\n\n"},{"id":"410468","messageId":"xmqqtutisdfk.fsf@gitster.c.googlers.com","threadId":"54004","inReplyTo":"20201120115522.23617-1-avarab@gmail.com","subject":"Re: [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-21T19:43:59Z","receivedAt":"2020-11-21T19:44:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> The --keep-base-pack option never existed in git.git. It was the name\n> for the --keep-largest-pack option in earlier revisions of that series\n> before it landed as ae4e89e549 (\"gc: add --keep-largest-pack option\",\n> 2018-04-15).\n\nIs it a sign that this hasn't been used by or useful to our users\nthat this documentation bug did not get noticed by anybody for the\npast 30 months, I wonder.\n\n\"git gc -h\" does report the option with correct name, which is the\nbeauty of automation ;-)\n\nThanks, both.  Will queue, together with [2/2] which also makes\nsense.\n"},{"id":"410518","messageId":"87h7pgpea2.fsf@evledraar.gmail.com","threadId":"54004","inReplyTo":"xmqqtutisdfk.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2020-11-23T10:18:29Z","receivedAt":"2020-11-23T10:18:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Nov 21 2020, Junio C Hamano wrote:\n\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> The --keep-base-pack option never existed in git.git. It was the name\n>> for the --keep-largest-pack option in earlier revisions of that series\n>> before it landed as ae4e89e549 (\"gc: add --keep-largest-pack option\",\n>> 2018-04-15).\n>\n> Is it a sign that this hasn't been used by or useful to our users\n> that this documentation bug did not get noticed by anybody for the\n> past 30 months, I wonder.\n\nFWIW I used it in a major git deployment since before it landed on\n\"master\" as gc.bigPackThreshold, but not the CLI option. \n\nI think a lot of these CLI options for gc/repack are relatively unused\ncompared to the config, but it's still arguably useful to have them for\none-off testing (although you could also just use \"git -c ...\").\n\n> \"git gc -h\" does report the option with correct name, which is the\n> beauty of automation ;-)\n>\n> Thanks, both.  Will queue, together with [2/2] which also makes\n> sense.\n\n"}]}