From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] gpg-interface: lazily initialize and read the configuration
Date: Mon, 27 Feb 2023 08:00:33 -0800 [thread overview]
Message-ID: <xmqqpm9vt7xa.fsf@gitster.g> (raw)
In-Reply-To: <Y/vf7n2+LN/3Nddi@coredump.intra.peff.net> (Jeff King's message of "Sun, 26 Feb 2023 17:40:46 -0500")
Jeff King <peff@peff.net> writes:
> Sorry, I seem to have missed this when you originally posted it. And I
> saw it marked as "will merge to next?" in the latest what's cooking. It
> looks good to me, and I think we can proceed with it (though of course
> it is not urgent and can probably wait until post-2.40).
> ...
> Yes, I think it is good not to do so in this patch. If we want to do it
> now on top, here's a patch. Though I could also see the argument for
> just leaving them.
Ah, of course I completely forgot about the patch and mentioning a
possible follow-on work.
> I looked over the output of:
>
> git grep --function-context 'return git_default_config'
>
> to see if there were other cases, not caused by fd2d4c135e. But I didn't
> see any.
>
> builtin/am.c | 7 +------
> builtin/commit-tree.c | 7 +------
> builtin/verify-commit.c | 7 +------
> builtin/verify-tag.c | 7 +------
> 4 files changed, 4 insertions(+), 24 deletions(-)
Nice to see these reductions. Thanks.
> diff --git a/builtin/am.c b/builtin/am.c
> index 40126b59c5..fccf40f8ee 100644
> --- a/builtin/am.c
> +++ b/builtin/am.c
> @@ -2312,11 +2312,6 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
> return 0;
> }
>
> -static int git_am_config(const char *k, const char *v, void *cb UNUSED)
> -{
> - return git_default_config(k, v, NULL);
> -}
> -
> int cmd_am(int argc, const char **argv, const char *prefix)
> {
> struct am_state state;
> @@ -2440,7 +2435,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
> if (argc == 2 && !strcmp(argv[1], "-h"))
> usage_with_options(usage, options);
>
> - git_config(git_am_config, NULL);
> + git_config(git_default_config, NULL);
>
> am_state_init(&state);
>
> diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
> index f6a099d601..c0bbe9373d 100644
> --- a/builtin/commit-tree.c
> +++ b/builtin/commit-tree.c
> @@ -37,11 +37,6 @@ static void new_parent(struct commit *parent, struct commit_list **parents_p)
> commit_list_insert(parent, parents_p);
> }
>
> -static int commit_tree_config(const char *var, const char *value, void *cb)
> -{
> - return git_default_config(var, value, cb);
> -}
> -
> static int parse_parent_arg_callback(const struct option *opt,
> const char *arg, int unset)
> {
> @@ -118,7 +113,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
> OPT_END()
> };
>
> - git_config(commit_tree_config, NULL);
> + git_config(git_default_config, NULL);
>
> if (argc < 2 || !strcmp(argv[1], "-h"))
> usage_with_options(commit_tree_usage, options);
> diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c
> index 3c5d0b024c..7aedf10e85 100644
> --- a/builtin/verify-commit.c
> +++ b/builtin/verify-commit.c
> @@ -52,11 +52,6 @@ static int verify_commit(const char *name, unsigned flags)
> return run_gpg_verify((struct commit *)obj, flags);
> }
>
> -static int git_verify_commit_config(const char *var, const char *value, void *cb)
> -{
> - return git_default_config(var, value, cb);
> -}
> -
> int cmd_verify_commit(int argc, const char **argv, const char *prefix)
> {
> int i = 1, verbose = 0, had_error = 0;
> @@ -67,7 +62,7 @@ int cmd_verify_commit(int argc, const char **argv, const char *prefix)
> OPT_END()
> };
>
> - git_config(git_verify_commit_config, NULL);
> + git_config(git_default_config, NULL);
>
> argc = parse_options(argc, argv, prefix, verify_commit_options,
> verify_commit_usage, PARSE_OPT_KEEP_ARGV0);
> diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
> index ecffb069bf..5c00b0b0f7 100644
> --- a/builtin/verify-tag.c
> +++ b/builtin/verify-tag.c
> @@ -19,11 +19,6 @@ static const char * const verify_tag_usage[] = {
> NULL
> };
>
> -static int git_verify_tag_config(const char *var, const char *value, void *cb)
> -{
> - return git_default_config(var, value, cb);
> -}
> -
> int cmd_verify_tag(int argc, const char **argv, const char *prefix)
> {
> int i = 1, verbose = 0, had_error = 0;
> @@ -36,7 +31,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
> OPT_END()
> };
>
> - git_config(git_verify_tag_config, NULL);
> + git_config(git_default_config, NULL);
>
> argc = parse_options(argc, argv, prefix, verify_tag_options,
> verify_tag_usage, PARSE_OPT_KEEP_ARGV0);
next prev parent reply other threads:[~2023-02-27 16:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 15:56 git rev-list fails to verify ssh-signed commits (but git log works) Max Gautier
2023-02-08 16:43 ` Jeff King
2023-02-08 17:56 ` Junio C Hamano
2023-02-08 18:20 ` Junio C Hamano
2023-02-08 20:31 ` [PATCH] gpg-interface: lazily initialize and read the configuration Junio C Hamano
2023-02-09 0:17 ` Ævar Arnfjörð Bjarmason
2023-02-09 2:05 ` Junio C Hamano
2023-02-09 2:24 ` Ævar Arnfjörð Bjarmason
2023-02-09 12:49 ` Jeff King
2023-02-09 16:38 ` Junio C Hamano
2023-02-09 20:24 ` [PATCH v2] " Junio C Hamano
2023-02-26 22:40 ` Jeff King
2023-02-27 16:00 ` Junio C Hamano [this message]
2023-03-08 8:34 ` Ævar Arnfjörð Bjarmason
2023-03-09 3:28 ` Jeff King
2023-03-09 17:03 ` Junio C Hamano
2023-03-10 9:01 ` Jeff King
2023-02-09 12:41 ` git rev-list fails to verify ssh-signed commits (but git log works) Jeff King
2023-02-09 16:44 ` Junio C Hamano
2023-02-08 17:00 ` 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=xmqqpm9vt7xa.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.