git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cherry-pick, revert: add the --gpg-sign option

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 3, 2013, 18:48 UTC
Message-ID
<20131103184830.GB183446@vauxhall.crustytoothpaste.net>
In-Reply-To
<1383504375-22743-1-git-send-email-boklm@mars-attacks.org>
On Sun, Nov 03, 2013 at 07:46:15PM +0100, Nicolas Vigier wrote:
Show 41 quoted lines
> diff --git a/sequencer.c b/sequencer.c
> index 06e52b4c83ff..2048cd81b3b2 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -392,11 +392,18 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
>  {
>  	struct argv_array array;
>  	int rc;
> +	char *gpg_sign;
>  
>  	argv_array_init(&array);
>  	argv_array_push(&array, "commit");
>  	argv_array_push(&array, "-n");
>  
> +	if (opts->gpg_sign) {
> +		gpg_sign = xmalloc(3 + strlen(opts->gpg_sign));
> +		sprintf(gpg_sign, "-S%s", opts->gpg_sign);
> +		argv_array_push(&array, gpg_sign);
> +		free(gpg_sign);
> +	}
>  	if (opts->signoff)
>  		argv_array_push(&array, "-s");
>  	if (!opts->edit) {
> @@ -808,6 +815,8 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
>  		opts->mainline = git_config_int(key, value);
>  	else if (!strcmp(key, "options.strategy"))
>  		git_config_string(&opts->strategy, key, value);
> +	else if (!strcmp(key, "options.gpg-sign"))
> +		git_config_string(&opts->gpg_sign, key, value);
>  	else if (!strcmp(key, "options.strategy-option")) {
>  		ALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);
>  		opts->xopts[opts->xopts_nr++] = xstrdup(value);
> @@ -981,6 +990,8 @@ static void save_opts(struct replay_opts *opts)
>  	}
>  	if (opts->strategy)
>  		git_config_set_in_file(opts_file, "options.strategy", opts->strategy);
> +	if (opts->gpg_sign)
> +		git_config_set_in_file(opts_file, "options.gpg-sign", opts->gpg_sign);
>  	if (opts->xopts) {
>  		int i;
>  		for (i = 0; i < opts->xopts_nr; i++)

Looks much better. That's essentially what I did when I was patching that particular area. Thanks for posting this patch set; it's something I've wanted for a while, but never got around to actually doing myself.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Nicolas VigierNext: Nicolas Vigier
Message 6 of 15 in “Adding --gpg-sign to cherry-pick, revert, am, rebase”
  1. Nicolas VigierNov 3, 2013
  2. 1/8 cherry-pick, revert: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  3. brian m. carlsonNov 3, 2013
  4. Nicolas VigierNov 3, 2013
  5. cherry-pick, revert: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  6. brian m. carlsonNov 3, 2013
  7. 2/8 git-sh-setup.sh: add variable to use the stuck-long modeNicolas Vigier, Nov 3, 2013
  8. 3/8 am: parse options in stuck-long modeNicolas Vigier, Nov 3, 2013
  9. 4/8 am: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  10. am: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  11. 5/8 rebase: remove useless arguments checkNicolas Vigier, Nov 3, 2013
  12. 6/8 rebase: don't try to match -M optionNicolas Vigier, Nov 3, 2013
  13. 7/8 rebase: parse options in stuck-long modeNicolas Vigier, Nov 3, 2013
  14. 8/8 rebase: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  15. brian m. carlsonDec 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.