@matheusbsbs / matheus-bagliano / commits / 7c390d90e8
Fork 0

git-stash: use stdout instead of stderr for non error messages

Some scripts and libraries check stderr to detect a failing command, instead of checking the exit code. Because the output from git-status is not primarily for machine consumption, it would not hurt to send these messages to stdout instead and it will make it easier to drive the command for such callers. Signed-off-by: Marco Costalba <mcostalba@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Marco Costalba committed Jan 5, 2008 at 09:57 UTC 7c390d90e8b6322948f45cecc658d62813c0d5ae
1 file changed +3 -3
git-stash.sh
+3 -3
@@ -86,7 +86,7 @@ save_stash () {
86
87 if no_changes
88 then
89 - echo >&2 'No local changes to save'
89 + echo 'No local changes to save'
90 exit 0
91 fi
92 test -f "$GIT_DIR/logs/$ref_stash" ||
@@ -99,7 +99,7 @@ save_stash () {
99
100 git update-ref -m "$stash_msg" $ref_stash $w_commit ||
101 die "Cannot save the current status"
102 - printf >&2 'Saved working directory and index state "%s"\n' "$stash_msg"
102 + printf 'Saved working directory and index state "%s"\n' "$stash_msg"
103 }
104
105 have_stash () {
@@ -229,7 +229,7 @@ create)
229 if test $# -eq 0
230 then
231 save_stash &&
232 - echo >&2 '(To restore them type "git stash apply")' &&
232 + echo '(To restore them type "git stash apply")' &&
233 git-reset --hard
234 else
235 usage