1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

sequencer: print autostash messages to stderr

The rebase messages are printed to stderr traditionally. However due
to a bug introduced in 587947750b (rebase: implement --[no-]autostash
and rebase.autostash, 2013-05-12) which was faithfully copied when
reimplementing parts of the interactive rebase in the sequencer the
autostash messages are printed to stdout instead.

It is time to fix that: let's print the autostash messages to stderr
instead of stdout.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin 2017-06-19 18:56:02 +01:00 committed by Junio C Hamano
parent d096d7f1ef
commit cdb866b30b
2 changed files with 8 additions and 7 deletions

View file

@ -165,14 +165,14 @@ apply_autostash () {
stash_sha1=$(cat "$state_dir/autostash")
if git stash apply $stash_sha1 2>&1 >/dev/null
then
echo "$(gettext 'Applied autostash.')"
echo "$(gettext 'Applied autostash.')" >&2
else
git stash store -m "autostash" -q $stash_sha1 ||
die "$(eval_gettext "Cannot store \$stash_sha1")"
gettext 'Applying autostash resulted in conflicts.
Your changes are safe in the stash.
You can run "git stash pop" or "git stash drop" at any time.
'
' >&2
fi
fi
}

View file

@ -1904,7 +1904,7 @@ static int apply_autostash(struct replay_opts *opts)
argv_array_push(&child.args, "apply");
argv_array_push(&child.args, stash_sha1.buf);
if (!run_command(&child))
printf(_("Applied autostash.\n"));
fprintf(stderr, _("Applied autostash.\n"));
else {
struct child_process store = CHILD_PROCESS_INIT;
@ -1918,10 +1918,11 @@ static int apply_autostash(struct replay_opts *opts)
if (run_command(&store))
ret = error(_("cannot store %s"), stash_sha1.buf);
else
printf(_("Applying autostash resulted in conflicts.\n"
"Your changes are safe in the stash.\n"
"You can run \"git stash pop\" or"
" \"git stash drop\" at any time.\n"));
fprintf(stderr,
_("Applying autostash resulted in conflicts.\n"
"Your changes are safe in the stash.\n"
"You can run \"git stash pop\" or"
" \"git stash drop\" at any time.\n"));
}
strbuf_release(&stash_sha1);