Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Phillip Wood <phillip.wood@dunelm.org.uk>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] rebase -i: silence stash apply
Date: Thu, 18 May 2017 12:49:57 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1.1705181246430.3610@virtualbox> (raw)
In-Reply-To: <20170518100233.30559-3-phillip.wood@talktalk.net>

Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:

> diff --git a/sequencer.c b/sequencer.c
> index f8bc18badf1a3fb1b39656501c5a316e229968d2..311728a145dfc66e230334221a2610468239932d 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -1914,6 +1914,8 @@ static int apply_autostash(struct replay_opts *opts)
>  	strbuf_trim(&stash_sha1);
>  
>  	child.git_cmd = 1;
> +	child.no_stdout = 1;
> +	child.no_stderr = 1;
>  	argv_array_push(&child.args, "stash");
>  	argv_array_push(&child.args, "apply");
>  	argv_array_push(&child.args, stash_sha1.buf);

If I remember correctly, then the shell version prints the output in case
of an error.

We already imitated that behavior in `git commit`
(https://github.com/git-for-windows/git/blob/v2.13.0.windows.1/sequencer.c#L674-L684):

		/* hide stderr on success */
		struct strbuf buf = STRBUF_INIT;
		int rc = pipe_command(&cmd,
				      NULL, 0,
				      /* stdout is already redirected */
				      NULL, 0,
				      &buf, 0);
		if (rc)
			fputs(buf.buf, stderr);
		strbuf_release(&buf);

I think that would be the appropriate approach here, too.

Ciao,
Johannes

P.S.: it may be a very good idea to accompany this patch (as well as the
previous one) by a patch to the test suite to verify that the fixed code
does not regress.

  reply	other threads:[~2017-05-18 12:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 10:02 [PATCH 0/2] Fix a couple of minor rebase -i regressions Phillip Wood
2017-05-18 10:02 ` [PATCH 1/2] rebase -i: fix reflog message Phillip Wood
2017-05-18 10:02 ` [PATCH 2/2] rebase -i: silence stash apply Phillip Wood
2017-05-18 10:49   ` Johannes Schindelin [this message]
2017-05-18 14:51     ` Phillip Wood
2017-05-18 21:19       ` Johannes Schindelin

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=alpine.DEB.2.21.1.1705181246430.3610@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@dunelm.org.uk \
    /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