All of lore.kernel.org
 help / color / mirror / Atom feed
From: Renee Margaret McConahy <nepella@gmail.com>
To: git@vger.kernel.org
Cc: Paul Tan <pyokagan@gmail.com>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2] am: configure gpg at startup
Date: Wed, 30 Sep 2015 13:49:44 -0400	[thread overview]
Message-ID: <560c3c62.65086b0a.538a7.328a@mx.google.com> (raw)
In-Reply-To: <xmqqtwqb7lqn.fsf@gitster.mtv.corp.google.com>

The new builtin am ignores the user.signingkey variable: gpg is being
called with the committer details as the key ID, which may not be
correct. git_gpg_config is responsible for handling that variable and is
expected to be called on initialization by any modules that use gpg.

Perhaps git_gpg_config's functionality ought to be merged into
git_default_config, but this is simpler and in keeping with the current
practice.

Signed-off-by: Renee Margaret McConahy <nepella@gmail.com>
---
Oops, my bad. Thanks.

 builtin/am.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/builtin/am.c b/builtin/am.c
index 4f77e07..3bd4fd7 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2208,6 +2208,17 @@ enum resume_mode {
 	RESUME_ABORT
 };
 
+static int git_am_config(const char *k, const char *v, void *cb)
+{
+	int status;
+
+	status = git_gpg_config(k, v, NULL);
+	if (status)
+		return status;
+
+	return git_default_config(k, v, NULL);
+}
+
 int cmd_am(int argc, const char **argv, const char *prefix)
 {
 	struct am_state state;
@@ -2308,7 +2319,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 
-	git_config(git_default_config, NULL);
+	git_config(git_am_config, NULL);
 
 	am_state_init(&state, git_path("rebase-apply"));
 
-- 
2.5.3

      reply	other threads:[~2015-09-30 19:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 17:49 [PATCH] am: configure gpg at startup Renee Margaret McConahy
2015-09-30 18:53 ` Eric Sunshine
2015-09-30 19:25 ` Junio C Hamano
2015-09-30 17:49   ` Renee Margaret McConahy [this message]

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=560c3c62.65086b0a.538a7.328a@mx.google.com \
    --to=nepella@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pyokagan@gmail.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 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.