git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: John Passaro <john.a.passaro@gmail.com>, git@vger.kernel.org
Subject: Re: silent_exec_failure when calling gpg
Date: Tue, 11 Dec 2018 04:56:33 -0500	[thread overview]
Message-ID: <20181211095633.GC31588@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqh8fkln5q.fsf@gitster-ct.c.googlers.com>

On Tue, Dec 11, 2018 at 01:09:37PM +0900, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
> 
> > John Passaro <john.a.passaro@gmail.com> writes:
> >
> >> I've noticed that in v2.19.1, when using git to pretty print
> >> information about the signature, if git cannot find gpg (e.g. "git
> >> config gpg.program nogpg"), it prints an error to stderr:
> >>
> >> $ git show -s --pretty=%G?
> >> fatal: cannot run nogpg: No such file or directory
> >> N
> >
> > I think the uninteded behaviour change was in 17809a98 ("Merge
> > branch 'jk/run-command-notdot'", 2018-10-30).
> 
> Perhaps something like this.  There needs an additional test added
> for this codepath, which I haven't done yet, though.

Thanks, both, for the report and the patch.

> diff --git a/run-command.c b/run-command.c
> index d679cc267c..e2bc18a083 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -728,6 +728,8 @@ int start_command(struct child_process *cmd)
>  	if (prepare_cmd(&argv, cmd) < 0) {
>  		failed_errno = errno;
>  		cmd->pid = -1;
> +		if (!cmd->silent_exec_failure)
> +			error_errno("cannot run %s", cmd->argv[0]);
>  		goto end_of_spawn;
>  	}

Yes, I think this is the right fix. For a test, I think we could just
do:

diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index cf932c8514..866268dfd1 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -33,7 +33,8 @@ test_expect_success 'run_command is restricted to PATH' '
 	write_script should-not-run <<-\EOF &&
 	echo yikes
 	EOF
-	test_must_fail test-tool run-command run-command should-not-run
+	test_must_fail test-tool run-command run-command should-not-run 2>err &&
+	grep should-not-run err
 '
 
 test_expect_success !MINGW 'run_command can run a script without a #! line' '


I assume you'll wrap that up into a real commit?

-Peff

      reply	other threads:[~2018-12-11  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 22:32 silent_exec_failure when calling gpg John Passaro
2018-12-11  3:44 ` Junio C Hamano
2018-12-11  4:09   ` Junio C Hamano
2018-12-11  9:56     ` Jeff King [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=20181211095633.GC31588@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=john.a.passaro@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).