stash: don't show internal implementation details
git stash push uses other git commands internally. Currently it only passes the -q flag to those if the -q flag is passed to git stash. when using 'git stash push -p -q --no-keep-index', it doesn't even pass the flag on to the internal reset at all. It really is enough for the user to know that the stash is created, without bothering them with the internal details of what's happening. Always pass the -q flag to the internal git clean and git reset commands, to avoid unnecessary and potentially confusing output. Reported-by: Jeff King <peff@peff.net> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Gummerer committed
Mar 21, 2017 at 22:12 UTC
1790f4fea04c2401feda0c96e35a3b50b1ba4fe3
2 files changed
+5
-5
git-stash.sh
+4
-4
@@ -299,12 +299,12 @@ push_stash () {
299
then
300
if test $# != 0
301
then
302
- git reset ${GIT_QUIET:+-q} -- "$@"
302
+ git reset -q -- "$@"
303
git ls-files -z --modified -- "$@" |
304
git checkout-index -z --force --stdin
305
- git clean --force ${GIT_QUIET:+-q} -d -- "$@"
305
+ git clean --force -q -d -- "$@"
306
else
307
- git reset --hard ${GIT_QUIET:+-q}
307
+ git reset --hard -q
308
fi
309
test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=
310
if test -n "$untracked"
@@ -322,7 +322,7 @@ push_stash () {
322
323
if test "$keep_index" != "t"
324
then
325
- git reset
325
+ git reset -q
326
fi
327
fi
328
}
t/t3903-stash.sh
+1
-1
@@ -663,7 +663,7 @@ test_expect_success 'stash apply shows status same as git status (relative to cu
663
sane_unset GIT_MERGE_VERBOSITY &&
664
git stash apply
665
) |
666
- sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..."
666
+ sed -e 1d >actual && # drop "Saved..."
667
test_i18ncmp expect actual
668
'
669