Skip to content

Commit 1790f4f

Browse files
tgummerergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gummerer <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9e14090 commit 1790f4f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

git-stash.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ push_stash () {
299299
then
300300
if test $# != 0
301301
then
302-
git reset ${GIT_QUIET:+-q} -- "$@"
302+
git reset -q -- "$@"
303303
git ls-files -z --modified -- "$@" |
304304
git checkout-index -z --force --stdin
305-
git clean --force ${GIT_QUIET:+-q} -d -- "$@"
305+
git clean --force -q -d -- "$@"
306306
else
307-
git reset --hard ${GIT_QUIET:+-q}
307+
git reset --hard -q
308308
fi
309309
test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=
310310
if test -n "$untracked"
@@ -322,7 +322,7 @@ push_stash () {
322322

323323
if test "$keep_index" != "t"
324324
then
325-
git reset
325+
git reset -q
326326
fi
327327
fi
328328
}

t/t3903-stash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ test_expect_success 'stash apply shows status same as git status (relative to cu
663663
sane_unset GIT_MERGE_VERBOSITY &&
664664
git stash apply
665665
) |
666-
sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..."
666+
sed -e 1d >actual && # drop "Saved..."
667667
test_i18ncmp expect actual
668668
'
669669

0 commit comments

Comments
 (0)