From: Taylor Blau <me@ttaylorr.com>
To: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com,
Eric Sunshine <sunshine@sunshineco.com>,
Emily Shaffer <emilyshaffer@google.com>,
Derrick Stolee <derrickstolee@github.com>,
Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH 1/2] maintenance: set log.excludeDecoration durin prefetch
Date: Mon, 18 Jan 2021 10:57:47 -0500 [thread overview]
Message-ID: <YAWv+5HDxEvBK+8R@nand.local> (raw)
In-Reply-To: <5b2ce9049a69d4c450093433e4fa15c4e5e0c412.1610940216.git.gitgitgadget@gmail.com>
Not related to the patch below, but in the subject line: s/durin/\0g/.
On Mon, Jan 18, 2021 at 03:23:35AM +0000, Derrick Stolee via GitGitGadget wrote:
> diff --git a/builtin/gc.c b/builtin/gc.c
> index b315b2ad588..54bae7f0c4c 100644
> --- a/builtin/gc.c
> +++ b/builtin/gc.c
> @@ -897,6 +897,12 @@ static int maintenance_task_prefetch(struct maintenance_run_opts *opts)
> struct string_list_item *item;
> struct string_list remotes = STRING_LIST_INIT_DUP;
>
> + git_config_set_multivar_gently("log.excludedecoration",
> + "refs/prefetch/",
> + "refs/prefetch/",
> + CONFIG_FLAGS_FIXED_VALUE |
> + CONFIG_FLAGS_MULTI_REPLACE);
> +
OK; this is a good way to ensure that you're not constantly appending
'refs/prefetch' into the config.
I did notice that we have a 'remotes' string list just above, so I
suppose we could only ignore 'refs/prefetch/<remote>' for just the
remotes that we know about, but I doubt that this would be all that
useful. (I.e., are there really users that are using refs/prefetch
already and don't want to hide the parts of it that aren't managed by
maintenance? Doubtful.)
> +test_expect_success 'prefetch and existing log.excludeDecoration values' '
> + git config --unset-all log.excludeDecoration &&
> + git config log.excludeDecoration refs/remotes/remote1/ &&
> + git maintenance run --task=prefetch &&
> +
> + git config --get-all log.excludeDecoration >out &&
> + grep refs/remotes/remote1/ out &&
> + grep refs/prefetch/ out &&
> +
> + git log --oneline --decorate --all >log &&
> + ! grep "prefetch" log &&
> + ! grep "remote1" log &&
> + grep "remote2" log &&
> +
> + # a second run does not change the config
> + git maintenance run --task=prefetch &&
> + git log --oneline --decorate --all >log2 &&
> + test_cmp log log2
Great, this test matches what I would expect. Thank you!
Thanks,
Taylor
next prev parent reply other threads:[~2021-01-18 15:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-18 3:23 [PATCH 0/2] Two cleanups around 'prefetch' refs Derrick Stolee via GitGitGadget
2021-01-18 3:23 ` [PATCH 1/2] maintenance: set log.excludeDecoration durin prefetch Derrick Stolee via GitGitGadget
2021-01-18 15:57 ` Taylor Blau [this message]
2021-01-18 3:23 ` [PATCH 2/2] t7900: clean up some broken refs Derrick Stolee via GitGitGadget
2021-01-18 16:04 ` Taylor Blau
2021-01-18 18:24 ` Derrick Stolee
2021-01-19 12:52 ` [PATCH v2 0/2] Two cleanups around 'prefetch' refs Derrick Stolee via GitGitGadget
2021-01-19 12:52 ` [PATCH v2 1/2] maintenance: set log.excludeDecoration durin prefetch Derrick Stolee via GitGitGadget
2021-01-21 2:06 ` Junio C Hamano
2021-01-19 12:52 ` [PATCH v2 2/2] t7900: clean up some broken refs Derrick Stolee via GitGitGadget
2021-01-21 2:38 ` Junio C Hamano
2021-01-19 14:24 ` [PATCH v2 0/2] Two cleanups around 'prefetch' refs Taylor Blau
2021-01-21 2:45 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YAWv+5HDxEvBK+8R@nand.local \
--to=me@ttaylorr.com \
--cc=derrickstolee@github.com \
--cc=dstolee@microsoft.com \
--cc=emilyshaffer@google.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).