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

Re: [PATCH] git-tag: don't use gpg's stdin, stdout when signing tags

From
Johannes Sixt <j6t@kdbg.org>
Date
Feb 20, 2009, 17:56 UTC
Message-ID
<499EEEEA.2040600@kdbg.org>
In-Reply-To
<20090220113856.6612.qmail@0bbdb5719a4668.315fe32.mid.smarden.org>
Gerrit Pape schrieb:
Show 6 quoted lines
>  	memset(&gpg, 0, sizeof(gpg));
>  	gpg.argv = args;
> -	gpg.in = -1;
> -	gpg.out = -1;
> +	gpg.in = 0;
> +	gpg.out = 1;

I assume you mean with this that gpg should read from fd 0 and write to fd 1, IOW, it should use the standard channels. If I am right, then the memset above has initialized gpg as needed already. Then gpg.argv is the only thing you are setting up in struct child_process gpg; but in this case you can use a convenience function...

>  	args[0] = "gpg";
>  	args[1] = "-bsau";
>  	args[2] = signingkey;
> -	args[3] = NULL;
...
> +	args[3] = "-o";
> +	args[4] = signpath;
> +	args[5] = unsignpath;
> +	args[6] = NULL;
...
> +	if (run_command(&gpg)) {
... here (note: no struct child_process needed):
	if (run_command_v_opt(args, 0)) {
(Just in case this patch is required...)
-- Hannes
Previous: Gerrit Pape
Message 4 of 4 in “git-tag: don't use gpg's stdin, stdout when signing tags”
  1. git-tag: don't use gpg's stdin, stdout when signing tagsGerrit Pape, Feb 20, 2009
  2. Todd ZullingerFeb 20, 2009
  3. Gerrit PapeFeb 23, 2009
  4. Johannes SixtFeb 20, 2009

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.