Code

Convert to use quiet option when available
authorDan Loewenherz <daniel.loewenherz@yale.edu>
Thu, 23 Apr 2009 01:46:02 +0000 (21:46 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2009 02:05:37 +0000 (19:05 -0700)
A minor fix that eliminates usage of "2>/dev/null" when --quiet or
-q has already been implemented.

Signed-off-by: Dan Loewenherz <daniel.loewenherz@yale.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-filter-branch.sh
git-merge-resolve.sh
git-parse-remote.sh
git-pull.sh

index b90d3df3a7db97dbc8a16e9e73b705d52bf8fd20..37e044db40bb89470bb64a4108c86d5173e03b5a 100755 (executable)
@@ -430,7 +430,7 @@ if [ "$filter_tag_name" ]; then
                if [ "$type" = "tag" ]; then
                        # Dereference to a commit
                        sha1t="$sha1"
-                       sha1="$(git rev-parse "$sha1"^{commit} 2>/dev/null)" || continue
+                       sha1="$(git rev-parse -q "$sha1"^{commit})" || continue
                fi
 
                [ -f "../map/$sha1" ] || continue
index 93bcfc2f5dce418d00f26257788932d5c738785c..c9da747fcfe504b1fd233c68d91e549def0f3571 100755 (executable)
@@ -37,10 +37,10 @@ then
        exit 2
 fi
 
-git update-index --refresh 2>/dev/null
+git update-index -q --refresh
 git read-tree -u -m --aggressive $bases $head $remotes || exit 2
 echo "Trying simple merge."
-if result_tree=$(git write-tree  2>/dev/null)
+if result_tree=$(git write-tree 2>/dev/null)
 then
        exit 0
 else
index 695a4094bb4230341618bd6f16d0bea9bff2e826..a296719861ec3b7aab5e530e67dc99b58267a56a 100755 (executable)
@@ -2,7 +2,7 @@
 
 # git-ls-remote could be called from outside a git managed repository;
 # this would fail in that case and would issue an error message.
-GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) || :;
+GIT_DIR=$(git rev-parse -q --git-dir) || :;
 
 get_data_source () {
        case "$1" in
index 8c750270e9ee1466180c2fbbc8e688d5131a17fe..35261539ab80ffa46fef945dce1a82c5636c1b49 100755 (executable)
@@ -147,7 +147,7 @@ then
        echo >&2 "Warning: fetch updated the current branch head."
        echo >&2 "Warning: fast forwarding your working tree from"
        echo >&2 "Warning: commit $orig_head."
-       git update-index --refresh 2>/dev/null
+       git update-index -q --refresh
        git read-tree -u -m "$orig_head" "$curr_head" ||
                die 'Cannot fast-forward your working tree.
 After making sure that you saved anything precious from