* gc docs: git gc --keep-base-pack ? @ 2020-08-06 21:49 Luc Van Oostenryck 2020-11-20 11:55 ` [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack Ævar Arnfjörð Bjarmason 2020-11-20 11:55 ` [PATCH 2/2] gc: rename keep_base_pack variable for --keep-largest-pack Ævar Arnfjörð Bjarmason 0 siblings, 2 replies; 5+ messages in thread From: Luc Van Oostenryck @ 2020-08-06 21:49 UTC (permalink / raw) To: GIT Mailing-list Hi, In git-gc.1, in the part describing gc.bigPackThreshold there is two references to an option '--keep-base-pack' but there is no such option (and it doesn't seem to correspond to '--keep-largest-pack'). Regards, -- Luc ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack 2020-08-06 21:49 gc docs: git gc --keep-base-pack ? Luc Van Oostenryck @ 2020-11-20 11:55 ` Ævar Arnfjörð Bjarmason 2020-11-21 19:43 ` Junio C Hamano 2020-11-20 11:55 ` [PATCH 2/2] gc: rename keep_base_pack variable for --keep-largest-pack Ævar Arnfjörð Bjarmason 1 sibling, 1 reply; 5+ messages in thread From: Ævar Arnfjörð Bjarmason @ 2020-11-20 11:55 UTC (permalink / raw) To: git Cc: Junio C Hamano, Luc Van Oostenryck, Nguyễn Thái Ngọc Duy, Ævar Arnfjörð Bjarmason The --keep-base-pack option never existed in git.git. It was the name for the --keep-largest-pack option in earlier revisions of that series before it landed as ae4e89e549 ("gc: add --keep-largest-pack option", 2018-04-15). The later patches in that series[1][2] weren't changed to also refer to --keep-largest-pack, so we've had this reference to a nonexisting option ever since the feature initially landed. 1. 55dfe13df9 ("gc: add gc.bigPackThreshold config", 2018-04-15) 2. 9806f5a7bf ("gc --auto: exclude base pack if not enough mem to "repack -ad"", 2018-04-15) Reported-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/config/gc.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt index 00ea0a678e..c834e07991 100644 --- a/Documentation/config/gc.txt +++ b/Documentation/config/gc.txt @@ -44,9 +44,9 @@ gc.autoDetach:: gc.bigPackThreshold:: If non-zero, all packs larger than this limit are kept when - `git gc` is run. This is very similar to `--keep-base-pack` + `git gc` is run. This is very similar to `--keep-largest-pack` except that all packs that meet the threshold are kept, not - just the base pack. Defaults to zero. Common unit suffixes of + just the largest pack. Defaults to zero. Common unit suffixes of 'k', 'm', or 'g' are supported. + Note that if the number of kept packs is more than gc.autoPackLimit, @@ -57,7 +57,7 @@ gc.autoPackLimit and gc.bigPackThreshold should be respected again. If the amount of memory estimated for `git repack` to run smoothly is not available and `gc.bigPackThreshold` is not set, the largest pack will also be excluded (this is the equivalent of running `git gc` with -`--keep-base-pack`). +`--keep-largest-pack`). gc.writeCommitGraph:: If true, then gc will rewrite the commit-graph file when -- 2.29.2.222.g5d2a92d10f8 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack 2020-11-20 11:55 ` [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack Ævar Arnfjörð Bjarmason @ 2020-11-21 19:43 ` Junio C Hamano 2020-11-23 10:18 ` Ævar Arnfjörð Bjarmason 0 siblings, 1 reply; 5+ messages in thread From: Junio C Hamano @ 2020-11-21 19:43 UTC (permalink / raw) To: Ævar Arnfjörð Bjarmason Cc: git, Luc Van Oostenryck, Nguyễn Thái Ngọc Duy Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > The --keep-base-pack option never existed in git.git. It was the name > for the --keep-largest-pack option in earlier revisions of that series > before it landed as ae4e89e549 ("gc: add --keep-largest-pack option", > 2018-04-15). Is it a sign that this hasn't been used by or useful to our users that this documentation bug did not get noticed by anybody for the past 30 months, I wonder. "git gc -h" does report the option with correct name, which is the beauty of automation ;-) Thanks, both. Will queue, together with [2/2] which also makes sense. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack 2020-11-21 19:43 ` Junio C Hamano @ 2020-11-23 10:18 ` Ævar Arnfjörð Bjarmason 0 siblings, 0 replies; 5+ messages in thread From: Ævar Arnfjörð Bjarmason @ 2020-11-23 10:18 UTC (permalink / raw) To: Junio C Hamano Cc: git, Luc Van Oostenryck, Nguyễn Thái Ngọc Duy On Sat, Nov 21 2020, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > >> The --keep-base-pack option never existed in git.git. It was the name >> for the --keep-largest-pack option in earlier revisions of that series >> before it landed as ae4e89e549 ("gc: add --keep-largest-pack option", >> 2018-04-15). > > Is it a sign that this hasn't been used by or useful to our users > that this documentation bug did not get noticed by anybody for the > past 30 months, I wonder. FWIW I used it in a major git deployment since before it landed on "master" as gc.bigPackThreshold, but not the CLI option. I think a lot of these CLI options for gc/repack are relatively unused compared to the config, but it's still arguably useful to have them for one-off testing (although you could also just use "git -c ..."). > "git gc -h" does report the option with correct name, which is the > beauty of automation ;-) > > Thanks, both. Will queue, together with [2/2] which also makes > sense. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] gc: rename keep_base_pack variable for --keep-largest-pack 2020-08-06 21:49 gc docs: git gc --keep-base-pack ? Luc Van Oostenryck 2020-11-20 11:55 ` [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack Ævar Arnfjörð Bjarmason @ 2020-11-20 11:55 ` Ævar Arnfjörð Bjarmason 1 sibling, 0 replies; 5+ messages in thread From: Ævar Arnfjörð Bjarmason @ 2020-11-20 11:55 UTC (permalink / raw) To: git Cc: Junio C Hamano, Luc Van Oostenryck, Nguyễn Thái Ngọc Duy, Ævar Arnfjörð Bjarmason As noted in an earlier change the keep_base_pack variable name is a relic from an earlier on-list version of ae4e89e549 ("gc: add --keep-largest-pack option", 2018-04-15) before it was renamed to --keep-largest-pack. Let's change the variable name to avoid that confusion, it's easier to read the code if there's a 1=1 mapping between the variable name and option name. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- builtin/gc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 5cd2a43f9f..07c15e4b64 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -533,7 +533,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) const char *name; pid_t pid; int daemonized = 0; - int keep_base_pack = -1; + int keep_largest_pack = -1; timestamp_t dummy; struct option builtin_gc_options[] = { @@ -547,7 +547,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) OPT_BOOL_F(0, "force", &force, N_("force running gc even if there may be another gc running"), PARSE_OPT_NOCOMPLETE), - OPT_BOOL(0, "keep-largest-pack", &keep_base_pack, + OPT_BOOL(0, "keep-largest-pack", &keep_largest_pack, N_("repack all other packs except the largest pack")), OPT_END() }; @@ -624,8 +624,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix) } else { struct string_list keep_pack = STRING_LIST_INIT_NODUP; - if (keep_base_pack != -1) { - if (keep_base_pack) + if (keep_largest_pack != -1) { + if (keep_largest_pack) find_base_packs(&keep_pack, 0); } else if (big_pack_threshold) { find_base_packs(&keep_pack, big_pack_threshold); -- 2.29.2.222.g5d2a92d10f8 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-23 10:22 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-08-06 21:49 gc docs: git gc --keep-base-pack ? Luc Van Oostenryck 2020-11-20 11:55 ` [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack Ævar Arnfjörð Bjarmason 2020-11-21 19:43 ` Junio C Hamano 2020-11-23 10:18 ` Ævar Arnfjörð Bjarmason 2020-11-20 11:55 ` [PATCH 2/2] gc: rename keep_base_pack variable for --keep-largest-pack Ævar Arnfjörð Bjarmason
git@vger.kernel.org list mirror (unofficial, one of many) This inbox may be cloned and mirrored by anyone: git clone --mirror https://public-inbox.org/git git clone --mirror http://ou63pmih66umazou.onion/git git clone --mirror http://czquwvybam4bgbro.onion/git git clone --mirror http://hjrcffqmbrq6wope.onion/git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V1 git git/ https://public-inbox.org/git \ git@vger.kernel.org public-inbox-index git Example config snippet for mirrors. Newsgroups are available over NNTP: nntp://news.public-inbox.org/inbox.comp.version-control.git nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git nntp://news.gmane.io/gmane.comp.version-control.git note: .onion URLs require Tor: https://www.torproject.org/ code repositories for the project(s) associated with this inbox: https://80x24.org/mirrors/git.git AGPL code for this site: git clone https://public-inbox.org/public-inbox.git