{"thread":{"id":"40459","subject":"[PATCH] am: configure gpg at startup","startedAt":"2015-09-30T17:49:44Z","lastAt":"2015-09-30T19:25:36Z","messageCount":4,"participants":["Renee Margaret McConahy","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"270940","messageId":"560c2efb.894f320a.d43ae.4338@mx.google.com","threadId":"40459","inReplyTo":null,"subject":"[PATCH] am: configure gpg at startup","fromName":"Renee Margaret McConahy","fromEmail":"nepella@gmail.com","sentAt":"2015-09-30T17:49:44Z","receivedAt":"2015-09-30T17:49:44Z","isPatch":true,"sender":{"key":"nepella@gmail.com","avatar":null},"body":"The new builtin am ignores the user.signingkey variable: gpg is being\ncalled with the committer details as the key ID, which may not be\ncorrect. git_gpg_config is responsible for handling that variable and is\nexpected to be called on initialization by any modules that use gpg.\n\nPerhaps git_gpg_config's functionality ought to be merged into\ngit_default_config, but this is simpler and in keeping with the current\npractice.\n\nSigned-off-by: Renee Margaret McConahy <nepella@gmail.com>\n---\n builtin/am.c | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 4f77e07..f0b0ffd 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -2208,6 +2208,18 @@ enum resume_mode {\n \tRESUME_ABORT\n };\n \n+static int git_am_config(const char *k, const char *v, void *cb)\n+{\n+\tint *flags = cb;\n+\tint status;\n+\n+\tstatus = git_gpg_config(k, v, NULL);\n+\tif (status)\n+\t\treturn status;\n+\n+\treturn git_default_config(k, v, NULL);\n+}\n+\n int cmd_am(int argc, const char **argv, const char *prefix)\n {\n \tstruct am_state state;\n@@ -2308,7 +2320,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \t\tOPT_END()\n \t};\n \n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_am_config, NULL);\n \n \tam_state_init(&state, git_path(\"rebase-apply\"));\n \n-- \n2.6.0\n"},{"id":"270949","messageId":"560c3c62.65086b0a.538a7.328a@mx.google.com","threadId":"40459","inReplyTo":"xmqqtwqb7lqn.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v2] am: configure gpg at startup","fromName":"Renee Margaret McConahy","fromEmail":"nepella@gmail.com","sentAt":"2015-09-30T17:49:44Z","receivedAt":"2015-09-30T17:49:44Z","isPatch":true,"sender":{"key":"nepella@gmail.com","avatar":null},"body":"The new builtin am ignores the user.signingkey variable: gpg is being\ncalled with the committer details as the key ID, which may not be\ncorrect. git_gpg_config is responsible for handling that variable and is\nexpected to be called on initialization by any modules that use gpg.\n\nPerhaps git_gpg_config's functionality ought to be merged into\ngit_default_config, but this is simpler and in keeping with the current\npractice.\n\nSigned-off-by: Renee Margaret McConahy <nepella@gmail.com>\n---\nOops, my bad. Thanks.\n\n builtin/am.c | 13 ++++++++++++-\n 1 file changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 4f77e07..3bd4fd7 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -2208,6 +2208,17 @@ enum resume_mode {\n \tRESUME_ABORT\n };\n \n+static int git_am_config(const char *k, const char *v, void *cb)\n+{\n+\tint status;\n+\n+\tstatus = git_gpg_config(k, v, NULL);\n+\tif (status)\n+\t\treturn status;\n+\n+\treturn git_default_config(k, v, NULL);\n+}\n+\n int cmd_am(int argc, const char **argv, const char *prefix)\n {\n \tstruct am_state state;\n@@ -2308,7 +2319,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \t\tOPT_END()\n \t};\n \n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_am_config, NULL);\n \n \tam_state_init(&state, git_path(\"rebase-apply\"));\n \n-- \n2.5.3\n"},{"id":"270941","messageId":"CAPig+cSqp+o+MNDyprF8SY1on-SZucTEHWc1Zi2QOnr_93k5jA@mail.gmail.com","threadId":"40459","inReplyTo":"560c2efb.894f320a.d43ae.4338@mx.google.com","subject":"Re: [PATCH] am: configure gpg at startup","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-09-30T18:53:39Z","receivedAt":"2015-09-30T18:53:39Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Sep 30, 2015 at 1:49 PM, Renee Margaret McConahy\n<nepella@gmail.com> wrote:\n> The new builtin am ignores the user.signingkey variable: gpg is being\n> called with the committer details as the key ID, which may not be\n> correct. git_gpg_config is responsible for handling that variable and is\n> expected to be called on initialization by any modules that use gpg.\n>\n> Perhaps git_gpg_config's functionality ought to be merged into\n> git_default_config, but this is simpler and in keeping with the current\n> practice.\n>\n> Signed-off-by: Renee Margaret McConahy <nepella@gmail.com>\n> ---\n> diff --git a/builtin/am.c b/builtin/am.c\n> index 4f77e07..f0b0ffd 100644\n> --- a/builtin/am.c\n> +++ b/builtin/am.c\n> @@ -2208,6 +2208,18 @@ enum resume_mode {\n>         RESUME_ABORT\n>  };\n>\n> +static int git_am_config(const char *k, const char *v, void *cb)\n> +{\n> +       int *flags = cb;\n\n'flags' seems to be unused.\n\n> +       int status;\n> +\n> +       status = git_gpg_config(k, v, NULL);\n> +       if (status)\n> +               return status;\n> +\n> +       return git_default_config(k, v, NULL);\n> +}\n> +\n>  int cmd_am(int argc, const char **argv, const char *prefix)\n>  {\n>         struct am_state state;\n> @@ -2308,7 +2320,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n>                 OPT_END()\n>         };\n>\n> -       git_config(git_default_config, NULL);\n> +       git_config(git_am_config, NULL);\n>\n>         am_state_init(&state, git_path(\"rebase-apply\"));\n>\n> --\n> 2.6.0\n"},{"id":"270945","messageId":"xmqqtwqb7lqn.fsf@gitster.mtv.corp.google.com","threadId":"40459","inReplyTo":"560c2efb.894f320a.d43ae.4338@mx.google.com","subject":"Re: [PATCH] am: configure gpg at startup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-30T19:25:36Z","receivedAt":"2015-09-30T19:25:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Renee Margaret McConahy <nepella@gmail.com> writes:\n\n> The new builtin am ignores the user.signingkey variable: gpg is being\n> called with the committer details as the key ID, which may not be\n> correct. git_gpg_config is responsible for handling that variable and is\n> expected to be called on initialization by any modules that use gpg.\n>\n> Perhaps git_gpg_config's functionality ought to be merged into\n> git_default_config, but this is simpler and in keeping with the current\n> practice.\n>\n> Signed-off-by: Renee Margaret McConahy <nepella@gmail.com>\n> ---\n\nThanks.\n\nI'd remove the unused \"flags\" (already pointed out by somebody, I\nthink), but otherwise the change looks sensible.\n\n\n>  builtin/am.c | 14 +++++++++++++-\n>  1 file changed, 13 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/am.c b/builtin/am.c\n> index 4f77e07..f0b0ffd 100644\n> --- a/builtin/am.c\n> +++ b/builtin/am.c\n> @@ -2208,6 +2208,18 @@ enum resume_mode {\n>  \tRESUME_ABORT\n>  };\n>  \n> +static int git_am_config(const char *k, const char *v, void *cb)\n> +{\n> +\tint *flags = cb;\n> +\tint status;\n> +\n> +\tstatus = git_gpg_config(k, v, NULL);\n> +\tif (status)\n> +\t\treturn status;\n> +\n> +\treturn git_default_config(k, v, NULL);\n> +}\n> +\n>  int cmd_am(int argc, const char **argv, const char *prefix)\n>  {\n>  \tstruct am_state state;\n> @@ -2308,7 +2320,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n>  \t\tOPT_END()\n>  \t};\n>  \n> -\tgit_config(git_default_config, NULL);\n> +\tgit_config(git_am_config, NULL);\n>  \n>  \tam_state_init(&state, git_path(\"rebase-apply\"));\n"}]}