{"thread":{"id":"49535","subject":"[PATCH] fixup! builtin rebase: support `--gpg-sign` option","startedAt":"2018-10-11T02:15:42Z","lastAt":"2018-10-12T09:39:03Z","messageCount":3,"participants":["Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"360131","messageId":"xmqqzhvlgref.fsf@gitster-ct.c.googlers.com","threadId":"49535","inReplyTo":null,"subject":"[PATCH] fixup! builtin rebase: support `--gpg-sign` option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-11T02:15:36Z","receivedAt":"2018-10-11T02:15:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate: Thu, 27 Sep 2018 14:48:17 +0200\n\nThe `--gpg-sign` option takes an *optional* argument, not a mandatory\none.\n\nThis was discovered as part of the investigation of\nhttps://github.com/git-for-windows/git/issues/1836.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n * I am sending this out as I want to mimize the number of\n   non-trivial changes that come into my tree without hitting the\n   list archive.\n\n builtin/rebase.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex a28bfbd62f..43bc6f7915 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -1030,8 +1030,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \t\tOPT_BOOL(0, \"autosquash\", &options.autosquash,\n \t\t\t N_(\"move commits that begin with \"\n \t\t\t    \"squash!/fixup! under -i\")),\n-\t\tOPT_STRING('S', \"gpg-sign\", &gpg_sign,\n-\t\t\t   N_(\"gpg-sign?\"), N_(\"GPG-sign commits\")),\n+\t\t{ OPTION_STRING, 'S', \"gpg-sign\", &gpg_sign, N_(\"key-id\"),\n+\t\t\tN_(\"GPG-sign commits\"),\n+\t\t\tPARSE_OPT_OPTARG, NULL, (intptr_t) \"\" },\n \t\tOPT_STRING_LIST(0, \"whitespace\", &whitespace,\n \t\t\t\tN_(\"whitespace\"), N_(\"passed to 'git apply'\")),\n \t\tOPT_SET_INT('C', 0, &opt_c, N_(\"passed to 'git apply'\"),\n-- \n2.19.1-328-g5a0cc8aca7\n\n"},{"id":"360132","messageId":"xmqqva69grb0.fsf@gitster-ct.c.googlers.com","threadId":"49535","inReplyTo":"xmqqzhvlgref.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] fixup! builtin rebase: support `--gpg-sign` option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-11T02:17:39Z","receivedAt":"2018-10-11T02:17:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date: Thu, 27 Sep 2018 14:48:17 +0200\n>\n> The `--gpg-sign` option takes an *optional* argument, not a mandatory\n> one.\n>\n> This was discovered as part of the investigation of\n> https://github.com/git-for-windows/git/issues/1836.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>\n>  * I am sending this out as I want to mimize the number of\n>    non-trivial changes that come into my tree without hitting the\n>    list archive.\n>\n>  builtin/rebase.c | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/rebase.c b/builtin/rebase.c\n> index a28bfbd62f..43bc6f7915 100644\n> --- a/builtin/rebase.c\n> +++ b/builtin/rebase.c\n> @@ -1030,8 +1030,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n>  \t\tOPT_BOOL(0, \"autosquash\", &options.autosquash,\n>  \t\t\t N_(\"move commits that begin with \"\n>  \t\t\t    \"squash!/fixup! under -i\")),\n> -\t\tOPT_STRING('S', \"gpg-sign\", &gpg_sign,\n> -\t\t\t   N_(\"gpg-sign?\"), N_(\"GPG-sign commits\")),\n> +\t\t{ OPTION_STRING, 'S', \"gpg-sign\", &gpg_sign, N_(\"key-id\"),\n> +\t\t\tN_(\"GPG-sign commits\"),\n> +\t\t\tPARSE_OPT_OPTARG, NULL, (intptr_t) \"\" },\n\nThis allows \"--gpg-sign\" in addition to \"--gpg-sign=ARG\" and stores\nan empty string in place of ARG when accepting the option without\narg.  \n\nThe result in gpg_sign is used by checking if the pointer is\nnon-NULL and formatted with xstrfmt(\"-S%s\", gpg_sign).\n\nThe change looks correct; will squash into what has been queued on\n'pu'.\n\nThanks.\n\n>  \t\tOPT_STRING_LIST(0, \"whitespace\", &whitespace,\n>  \t\t\t\tN_(\"whitespace\"), N_(\"passed to 'git apply'\")),\n>  \t\tOPT_SET_INT('C', 0, &opt_c, N_(\"passed to 'git apply'\"),\n"},{"id":"360290","messageId":"nycvar.QRO.7.76.6.1810121138310.45@tvgsbejvaqbjf.bet","threadId":"49535","inReplyTo":"xmqqzhvlgref.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] fixup! builtin rebase: support `--gpg-sign` option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-10-12T09:38:58Z","receivedAt":"2018-10-12T09:39:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 11 Oct 2018, Junio C Hamano wrote:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date: Thu, 27 Sep 2018 14:48:17 +0200\n> \n> The `--gpg-sign` option takes an *optional* argument, not a mandatory\n> one.\n> \n> This was discovered as part of the investigation of\n> https://github.com/git-for-windows/git/issues/1836.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n> \n>  * I am sending this out as I want to mimize the number of\n>    non-trivial changes that come into my tree without hitting the\n>    list archive.\n\nThanks, *much* appreciated.\n\nCiao,\nDscho\n\n> \n>  builtin/rebase.c | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/builtin/rebase.c b/builtin/rebase.c\n> index a28bfbd62f..43bc6f7915 100644\n> --- a/builtin/rebase.c\n> +++ b/builtin/rebase.c\n> @@ -1030,8 +1030,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n>  \t\tOPT_BOOL(0, \"autosquash\", &options.autosquash,\n>  \t\t\t N_(\"move commits that begin with \"\n>  \t\t\t    \"squash!/fixup! under -i\")),\n> -\t\tOPT_STRING('S', \"gpg-sign\", &gpg_sign,\n> -\t\t\t   N_(\"gpg-sign?\"), N_(\"GPG-sign commits\")),\n> +\t\t{ OPTION_STRING, 'S', \"gpg-sign\", &gpg_sign, N_(\"key-id\"),\n> +\t\t\tN_(\"GPG-sign commits\"),\n> +\t\t\tPARSE_OPT_OPTARG, NULL, (intptr_t) \"\" },\n>  \t\tOPT_STRING_LIST(0, \"whitespace\", &whitespace,\n>  \t\t\t\tN_(\"whitespace\"), N_(\"passed to 'git apply'\")),\n>  \t\tOPT_SET_INT('C', 0, &opt_c, N_(\"passed to 'git apply'\"),\n> -- \n> 2.19.1-328-g5a0cc8aca7\n> \n> \n"}]}