]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule update: direct error message to stderr
authorStefan Beller <sbeller@google.com>
Tue, 1 Mar 2016 02:07:14 +0000 (18:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Mar 2016 19:57:18 +0000 (11:57 -0800)
Reroute the error message for specified but initialized submodules
to stderr instead of stdout.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
t/t7400-submodule-basic.sh

index 9bc5c5f94d1d7b24dffae649cca371299540aa46..9ee86d4f5bf6c588baceb4323b54c709020315f2 100755 (executable)
@@ -693,7 +693,7 @@ cmd_update()
 
                if test "$update_module" = "none"
                then
-                       echo "Skipping submodule '$displaypath'"
+                       echo >&2 "Skipping submodule '$displaypath'"
                        continue
                fi
 
@@ -702,7 +702,7 @@ cmd_update()
                        # Only mention uninitialized submodules when its
                        # path have been specified
                        test "$#" != "0" &&
-                       say "$(eval_gettext "Submodule path '\$displaypath' not initialized
+                       say >&2 "$(eval_gettext "Submodule path '\$displaypath' not initialized
 Maybe you want to use 'update --init'?")"
                        continue
                fi
index 540771ca419b82e4dd32adf986545515fa1db66e..5991e3c015dc8e21c483ab74e858b508ef37a061 100755 (executable)
@@ -462,7 +462,7 @@ test_expect_success 'update --init' '
        git config --remove-section submodule.example &&
        test_must_fail git config submodule.example.url &&
 
-       git submodule update init > update.out &&
+       git submodule update init 2> update.out &&
        cat update.out &&
        test_i18ngrep "not initialized" update.out &&
        test_must_fail git rev-parse --resolve-git-dir init/.git &&
@@ -480,7 +480,7 @@ test_expect_success 'update --init from subdirectory' '
        mkdir -p sub &&
        (
                cd sub &&
-               git submodule update ../init >update.out &&
+               git submodule update ../init 2>update.out &&
                cat update.out &&
                test_i18ngrep "not initialized" update.out &&
                test_must_fail git rev-parse --resolve-git-dir ../init/.git &&