{"thread":{"id":"23098","subject":"[PATCH 1/4] stash: use --quiet rather than using 2>/dev/null","startedAt":"2010-03-20T02:18:35Z","lastAt":"2010-03-23T03:23:44Z","messageCount":9,"participants":["Benjamin C Meyer","Jonathan Nieder","Benjamin Meyer"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"137293","messageId":"1269051518-25099-1-git-send-email-bmeyer@rim.com","threadId":"23098","inReplyTo":null,"subject":"[PATCH 1/4] stash: use --quiet rather than using 2>/dev/null","fromName":"Benjamin C Meyer","fromEmail":"bmeyer@rim.com","sentAt":"2010-03-20T02:18:35Z","receivedAt":"2010-03-20T02:18:35Z","isPatch":true,"sender":{"key":"bmeyer@rim.com","avatar":null},"body":"Signed-off-by: Benjamin C Meyer <bmeyer@rim.com>\n---\n git-stash.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex aa47e54..2533185 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -39,7 +39,7 @@ clear_stash () {\n \tthen\n \t\tdie \"git stash clear with parameters is unimplemented\"\n \tfi\n-\tif current=$(git rev-parse --verify $ref_stash 2>/dev/null)\n+\tif current=$(git rev-parse --quiet --verify $ref_stash)\n \tthen\n \t\tgit update-ref -d $ref_stash $current\n \tfi\n@@ -201,7 +201,7 @@ save_stash () {\n }\n \n have_stash () {\n-\tgit rev-parse --verify $ref_stash >/dev/null 2>&1\n+\tgit rev-parse --quiet --verify $ref_stash >/dev/null\n }\n \n list_stash () {\n@@ -342,16 +342,16 @@ drop_stash () {\n \tfi\n \t# Verify supplied argument looks like a stash entry\n \ts=$(git rev-parse --verify \"$@\") &&\n-\tgit rev-parse --verify \"$s:\"   > /dev/null 2>&1 &&\n-\tgit rev-parse --verify \"$s^1:\" > /dev/null 2>&1 &&\n-\tgit rev-parse --verify \"$s^2:\" > /dev/null 2>&1 ||\n+\tgit rev-parse --quiet --verify \"$s:\"   > /dev/null &&\n+\tgit rev-parse --quiet --verify \"$s^1:\" > /dev/null &&\n+\tgit rev-parse --quiet --verify \"$s^2:\" > /dev/null ||\n \t\tdie \"$*: not a valid stashed state\"\n \n \tgit reflog delete --updateref --rewrite \"$@\" &&\n \t\tsay \"Dropped $* ($s)\" || die \"$*: Could not drop stash entry\"\n \n \t# clear_stash if we just dropped the last stash entry\n-\tgit rev-parse --verify \"$ref_stash@{0}\" > /dev/null 2>&1 || clear_stash\n+\tgit rev-parse --quiet --verify \"$ref_stash@{0}\" > /dev/null || clear_stash\n }\n \n apply_to_branch () {\n-- \n1.7.0.2\n"},{"id":"137294","messageId":"1269051518-25099-2-git-send-email-bmeyer@rim.com","threadId":"23098","inReplyTo":"1269051518-25099-1-git-send-email-bmeyer@rim.com","subject":"[PATCH 2/4] pull: use --quiet rather than 2>/dev/null","fromName":"Benjamin C Meyer","fromEmail":"bmeyer@rim.com","sentAt":"2010-03-20T02:18:36Z","receivedAt":"2010-03-20T02:18:36Z","isPatch":true,"sender":{"key":"bmeyer@rim.com","avatar":null},"body":"Signed-off-by: Benjamin C Meyer <bmeyer@rim.com>\n---\n git-pull.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex d45b50c..08dac0a 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -206,7 +206,7 @@ test true = \"$rebase\" && {\n \t. git-parse-remote &&\n \tremoteref=\"$(get_remote_merge_branch \"$@\" 2>/dev/null)\" &&\n \toldremoteref=\"$(git rev-parse -q --verify \"$remoteref\")\" &&\n-\tfor reflog in $(git rev-list -g $remoteref 2>/dev/null)\n+\tfor reflog in $(git rev-list --quiet -g $remoteref)\n \tdo\n \t\tif test \"$reflog\" = \"$(git merge-base $reflog $curr_branch)\"\n \t\tthen\n-- \n1.7.0.2\n"},{"id":"137295","messageId":"1269051518-25099-3-git-send-email-bmeyer@rim.com","threadId":"23098","inReplyTo":"1269051518-25099-1-git-send-email-bmeyer@rim.com","subject":"[PATCH 3/4] rebase: use --quiet rather than 2>/dev/null","fromName":"Benjamin C Meyer","fromEmail":"bmeyer@rim.com","sentAt":"2010-03-20T02:18:37Z","receivedAt":"2010-03-20T02:18:37Z","isPatch":true,"sender":{"key":"bmeyer@rim.com","avatar":null},"body":"Signed-off-by: Benjamin C Meyer <bmeyer@rim.com>\n---\n git-rebase.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex fb4fef7..bf93019 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -101,7 +101,7 @@ call_merge () {\n \tcmt=\"$(cat \"$dotest/cmt.$1\")\"\n \techo \"$cmt\" > \"$dotest/current\"\n \thd=$(git rev-parse --verify HEAD)\n-\tcmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)\n+\tcmt_name=$(git symbolic-ref --quiet HEAD || echo HEAD)\n \tmsgnum=$(cat \"$dotest/msgnum\")\n \tend=$(cat \"$dotest/end\")\n \teval GITHEAD_$cmt='\"${cmt_name##refs/heads/}~$(($end - $msgnum))\"'\n-- \n1.7.0.2\n"},{"id":"137296","messageId":"1269051518-25099-4-git-send-email-bmeyer@rim.com","threadId":"23098","inReplyTo":"1269051518-25099-1-git-send-email-bmeyer@rim.com","subject":"[PATCH 4/4] rebase-interactive: use --quiet rather than 2>/dev/null","fromName":"Benjamin C Meyer","fromEmail":"bmeyer@rim.com","sentAt":"2010-03-20T02:18:38Z","receivedAt":"2010-03-20T02:18:38Z","isPatch":true,"sender":{"key":"bmeyer@rim.com","avatar":null},"body":"Signed-off-by: Benjamin C Meyer <bmeyer@rim.com>\n---\n git-rebase--interactive.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 3e4fd14..6f6748c 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -793,7 +793,7 @@ first and then run 'git rebase --continue' again.\"\n \t\tmkdir \"$DOTEST\" || die \"Could not create temporary $DOTEST\"\n \n \t\t: > \"$DOTEST\"/interactive || die \"Could not mark as interactive\"\n-\t\tgit symbolic-ref HEAD > \"$DOTEST\"/head-name 2> /dev/null ||\n+\t\tgit symbolic-ref --quiet HEAD > \"$DOTEST\"/head-name ||\n \t\t\techo \"detached HEAD\" > \"$DOTEST\"/head-name\n \n \t\techo $HEAD > \"$DOTEST\"/head\n-- \n1.7.0.2\n"},{"id":"137327","messageId":"20100320123520.GA29041@progeny.tock","threadId":"23098","inReplyTo":"1269051518-25099-2-git-send-email-bmeyer@rim.com","subject":"Re: [PATCH 2/4] pull: use --quiet rather than 2>/dev/null","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-20T12:35:20Z","receivedAt":"2010-03-20T12:35:20Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Benjamin C Meyer wrote:\n\n> -\tfor reflog in $(git rev-list -g $remoteref 2>/dev/null)\n> +\tfor reflog in $(git rev-list --quiet -g $remoteref)\n\nAre you sure?  My local copy of git-rev-list.1 says\n\n    --quiet\n         Don’t print anything to standard output. This form is primarily meant\n         to allow the caller to test the exit status to see if a range of\n         objects is fully connected (or not). It is faster than redirecting\n         stdout to /dev/null as the output does not have to be formatted.\n\nA similar question applies to the other patches in this series: are\nyou sure they suppress the right output?  (I haven’t checked, just\nasking.)\n\nAside: that for loop looks like it could be improved.  Maybe it is worth\nfactoring this into a separate function, something like:\n\nold_upstream() {\n\tremoteref=$1 &&\n\tcurr_branch=$2 &&\n\n\toldremoteref=\"$(git rev-parse -q --verify \"$remoteref\")\" &&\n\t{ git rev-list -g \"$remoteref\" 2>/dev/null || return $?; } |\n\twhile read reflog\n\tdo\n\t\tif test -z \"$(git rev-list \"$curr_branch\"..\"$reflog\" | head -n 1)\"\n\t\tthen\n\t\t\tprintf \"%s\\n\" \"$reflog\"\n\t\t\treturn 0\n\t\tfi\n\tdone &&\n\tprintf \"%s\\n\" \"$oldremoteref\"\n}\n\nIn other words, we can avoid walking the whole reflog before starting\nto look for an ancestor for the current branch.\n\nJonathan\n"},{"id":"137362","messageId":"818FE4EC-5AE9-4F05-B9AD-E1753F7ED9E6@meyerhome.net","threadId":"23098","inReplyTo":"20100320123520.GA29041@progeny.tock","subject":"Re: [PATCH 2/4] pull: use --quiet rather than 2>/dev/null","fromName":"Benjamin Meyer","fromEmail":"ben@meyerhome.net","sentAt":"2010-03-20T18:59:25Z","receivedAt":"2010-03-20T18:59:25Z","isPatch":true,"sender":{"key":"ben@meyerhome.net","avatar":null},"body":"On Mar 20, 2010, at 8:35 AM, Jonathan Nieder wrote:\n\n> Benjamin C Meyer wrote:\n> \n>> -\tfor reflog in $(git rev-list -g $remoteref 2>/dev/null)\n>> +\tfor reflog in $(git rev-list --quiet -g $remoteref)\n> \n> Are you sure?  My local copy of git-rev-list.1 says\n> \n>   --quiet\n>        Don’t print anything to standard output. This form is primarily meant\n>        to allow the caller to test the exit status to see if a range of\n>        objects is fully connected (or not). It is faster than redirecting\n>        stdout to /dev/null as the output does not have to be formatted.\n> \n> A similar question applies to the other patches in this series: are\n> you sure they suppress the right output?  (I haven’t checked, just\n> asking.)\n\nThanks for reviewing the change\n\nYah looks like I made a mistake there, rev-list --quiet suppresses everything and not just stderr.  When going through this janitor task I noticed that the --quiet is very inconsistent among git commands.  Some suppress error messages, some suppress all messages.  This might be something to improve in the future as even though I kept referring to the documentation this error slipped in.\n\nre-checking the other patches I think they are correct in their usage.  I ran the matching tests, the rebase ones passed, 3903-stash.sh is already failing before my patch and t3904-stash-patch.sh continues passing with the patch.  Other then running the tests in t/ is there anything I should do to verify patches?\n\n> Aside: that for loop looks like it could be improved.  Maybe it is worth\n> factoring this into a separate function, something like:\n> \n> old_upstream() {\n> \tremoteref=$1 &&\n> \tcurr_branch=$2 &&\n> \n> \toldremoteref=\"$(git rev-parse -q --verify \"$remoteref\")\" &&\n> \t{ git rev-list -g \"$remoteref\" 2>/dev/null || return $?; } |\n> \twhile read reflog\n> \tdo\n> \t\tif test -z \"$(git rev-list \"$curr_branch\"..\"$reflog\" | head -n 1)\"\n> \t\tthen\n> \t\t\tprintf \"%s\\n\" \"$reflog\"\n> \t\t\treturn 0\n> \t\tfi\n> \tdone &&\n> \tprintf \"%s\\n\" \"$oldremoteref\"\n> }\n> \n> In other words, we can avoid walking the whole reflog before starting\n> to look for an ancestor for the current branch.\n\nThat looks like it would speed up that bit of code, but I am still figuring out the internals of git so I can't really comment on if this is the best solution etc.\n\n-Benjamin Meyer\n"},{"id":"137407","messageId":"20100321043330.GA9803@progeny.tock","threadId":"23098","inReplyTo":"818FE4EC-5AE9-4F05-B9AD-E1753F7ED9E6@meyerhome.net","subject":"Re: [PATCH 2/4] pull: use --quiet rather than 2>/dev/null","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-21T04:33:30Z","receivedAt":"2010-03-21T04:33:30Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi again,\n\nBenjamin Meyer wrote:\n\n> re-checking the other patches I think they are correct in their\n> usage.\n\nThanks for checking.\n\n> I ran the matching tests, the rebase ones passed,\n> 3903-stash.sh is already failing before my patch and\n> t3904-stash-patch.sh continues passing with the patch.  Other then\n> running the tests in t/ is there anything I should do to verify\n> patches?\n\nRegarding testing: the best thing to do IMHO is to explain in the commit\nmessage what effect the patch will have.  Then reviewers (including you)\ncan read it and try it out to make sure what you say is true.\n\nThe test suite is not very good for checking that a patch does what\nit’s meant to do, but that’s okay, since it has a different purpose [1].\n\nAs an example of what I mean, here is your patch 1/4 again (untested,\nthough).  I didn’t add any tests since it would be kind of hard to\nprovoke address space exhaustion at just the right moment.\n\n[1] See http://thread.gmane.org/gmane.comp.version-control.git/142480/focus=142745\n\n-- %< --\nFrom: Benjamin C Meyer <bmeyer@rim.com>\nSubject: scripts: use rev-parse --verify -q rather than using 2>/dev/null\n\nb1b3596 (2008-04-26) taught rev-parse --verify a --quiet option to\nsuppress the “fatal: Needed a single revision” message when its\nargument is not a valid object.  Use it; this simplifies scripts\nsomewhat, and it allows other errors (such as address space exhaustion)\nto be reported properly.\n\nSince --quiet does not suppress warnings about ambiguous ref names\nand inadequate reflogs, the redirection has been kept for call sites\nthat might involve either of these phenomena.\n\nSigned-off-by: Benjamin C Meyer <bmeyer@rim.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nt3903-stash.sh fails for me with your original patch.  Maybe you\nforgot to run 'make' before running tests?  I fixed it by putting\nback in the 2>&1 on the ... || clear_stash line.\n\n contrib/completion/git-completion.bash |    2 +-\n contrib/examples/git-checkout.sh       |   10 +++++-----\n contrib/examples/git-commit.sh         |    2 +-\n contrib/examples/git-fetch.sh          |    4 ++--\n contrib/examples/git-merge.sh          |   10 +++++-----\n contrib/examples/git-reset.sh          |    2 +-\n contrib/examples/git-revert.sh         |    4 ++--\n git-cvsimport.perl                     |    2 +-\n git-stash.sh                           |   13 +++++++------\n templates/hooks--pre-commit.sample     |    2 +-\n 10 files changed, 26 insertions(+), 25 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 733ac39..5b287e1 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -151,7 +151,7 @@ __git_ps1 ()\n \t\t\t\tfi\n \t\t\tfi\n \t\t\tif [ -n \"${GIT_PS1_SHOWSTASHSTATE-}\" ]; then\n-\t\t\t        git rev-parse --verify refs/stash >/dev/null 2>&1 && s=\"$\"\n+\t\t\t\tgit rev-parse --verify -q refs/stash >/dev/null && s=\"$\"\n \t\t\tfi\n \n \t\t\tif [ -n \"${GIT_PS1_SHOWUNTRACKEDFILES-}\" ]; then\ndiff --git a/contrib/examples/git-checkout.sh b/contrib/examples/git-checkout.sh\nindex 1a7689a..f735209 100755\n--- a/contrib/examples/git-checkout.sh\n+++ b/contrib/examples/git-checkout.sh\n@@ -16,7 +16,7 @@ SUBDIRECTORY_OK=Sometimes\n require_work_tree\n \n old_name=HEAD\n-old=$(git rev-parse --verify $old_name 2>/dev/null)\n+old=$(git rev-parse --verify -q $old_name)\n oldbranch=$(git symbolic-ref $old_name 2>/dev/null)\n new=\n new_name=\n@@ -71,8 +71,8 @@ while test $# != 0; do\n done\n \n arg=\"$1\"\n-rev=$(git rev-parse --verify \"$arg\" 2>/dev/null)\n-if rev=$(git rev-parse --verify \"$rev^0\" 2>/dev/null)\n+rev=$(git rev-parse --verify -q \"$arg\" 2>/dev/null)\n+if rev=$(git rev-parse --verify -q \"$rev^0\" 2>/dev/null)\n then\n \t[ -z \"$rev\" ] && die \"unknown flag $arg\"\n \tnew_name=\"$arg\"\n@@ -83,7 +83,7 @@ then\n \tfi\n \tnew=\"$rev\"\n \tshift\n-elif rev=$(git rev-parse --verify \"$rev^{tree}\" 2>/dev/null)\n+elif rev=$(git rev-parse --verify -q \"$rev^{tree}\" 2>/dev/null)\n then\n \t# checking out selected paths from a tree-ish.\n \tnew=\"$rev\"\n@@ -151,7 +151,7 @@ else\n \t# but switching branches.\n \tif test '' != \"$new\"\n \tthen\n-\t\tgit rev-parse --verify \"$new^{commit}\" >/dev/null 2>&1 ||\n+\t\tgit rev-parse --verify -q \"$new^{commit}\" >/dev/null 2>&1 ||\n \t\tdie \"Cannot switch branch to a non-commit.\"\n \tfi\n fi\ndiff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh\nindex 5c72f65..35626c5 100755\n--- a/contrib/examples/git-commit.sh\n+++ b/contrib/examples/git-commit.sh\n@@ -9,7 +9,7 @@ OPTIONS_SPEC=\n . git-sh-setup\n require_work_tree\n \n-git rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t\n+git rev-parse --verify -q HEAD >/dev/null || initial_commit=t\n \n case \"$0\" in\n *status)\ndiff --git a/contrib/examples/git-fetch.sh b/contrib/examples/git-fetch.sh\nindex e44af2c..a35f997 100755\n--- a/contrib/examples/git-fetch.sh\n+++ b/contrib/examples/git-fetch.sh\n@@ -124,7 +124,7 @@ append_fetch_head () {\n # repository is always fine.\n if test -z \"$update_head_ok\" && test $(is_bare_repository) = false\n then\n-\torig_head=$(git rev-parse --verify HEAD 2>/dev/null)\n+\torig_head=$(git rev-parse --verify -q HEAD)\n fi\n \n # Allow --notags from remote.$1.tagopt\n@@ -365,7 +365,7 @@ case \"$orig_head\" in\n '')\n \t;;\n ?*)\n-\tcurr_head=$(git rev-parse --verify HEAD 2>/dev/null)\n+\tcurr_head=$(git rev-parse --verify -q HEAD)\n \tif test \"$curr_head\" != \"$orig_head\"\n \tthen\n \t    git update-ref \\\ndiff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh\nindex 8f617fc..5ff2999 100755\n--- a/contrib/examples/git-merge.sh\n+++ b/contrib/examples/git-merge.sh\n@@ -130,7 +130,7 @@ finish () {\n \n merge_name () {\n \tremote=\"$1\"\n-\trh=$(git rev-parse --verify \"$remote^0\" 2>/dev/null) || return\n+\trh=$(git rev-parse --verify -q \"$remote^0\" 2>/dev/null) || return\n \tbh=$(git show-ref -s --verify \"refs/heads/$remote\" 2>/dev/null)\n \tif test \"$rh\" = \"$bh\"\n \tthen\n@@ -226,15 +226,15 @@ fi\n # have \"-m\" so it is an additional safety measure to check for it.\n \n if test -z \"$have_message\" &&\n-\tsecond_token=$(git rev-parse --verify \"$2^0\" 2>/dev/null) &&\n-\thead_commit=$(git rev-parse --verify \"HEAD\" 2>/dev/null) &&\n+\tsecond_token=$(git rev-parse --verify -q \"$2^0\" 2>/dev/null) &&\n+\thead_commit=$(git rev-parse --verify -q \"HEAD\") &&\n \ttest \"$second_token\" = \"$head_commit\"\n then\n \tmerge_msg=\"$1\"\n \tshift\n \thead_arg=\"$1\"\n \tshift\n-elif ! git rev-parse --verify HEAD >/dev/null 2>&1\n+elif ! git rev-parse --verify -q HEAD >/dev/null\n then\n \t# If the merged head is a valid one there is no reason to\n \t# forbid \"git merge\" into a branch yet to be born.  We do\n@@ -277,7 +277,7 @@ set_reflog_action \"merge $*\"\n remoteheads=\n for remote\n do\n-\tremotehead=$(git rev-parse --verify \"$remote\"^0 2>/dev/null) ||\n+\tremotehead=$(git rev-parse --verify -q \"$remote\"^0 2>/dev/null) ||\n \t    die \"$remote - not something we can merge\"\n \tremoteheads=\"${remoteheads}$remotehead \"\n \teval GITHEAD_$remotehead='\"$remote\"'\ndiff --git a/contrib/examples/git-reset.sh b/contrib/examples/git-reset.sh\nindex bafeb52..e09a9c4 100755\n--- a/contrib/examples/git-reset.sh\n+++ b/contrib/examples/git-reset.sh\n@@ -75,7 +75,7 @@ else\n fi\n \n # Any resets update HEAD to the head being switched to.\n-if orig=$(git rev-parse --verify HEAD 2>/dev/null)\n+if orig=$(git rev-parse --verify -q HEAD)\n then\n \techo \"$orig\" >\"$GIT_DIR/ORIG_HEAD\"\n else\ndiff --git a/contrib/examples/git-revert.sh b/contrib/examples/git-revert.sh\nindex 49f0032..5672b4f 100755\n--- a/contrib/examples/git-revert.sh\n+++ b/contrib/examples/git-revert.sh\n@@ -78,9 +78,9 @@ esac\n rev=$(git-rev-parse --verify \"$@\") &&\n commit=$(git-rev-parse --verify \"$rev^0\") ||\n \tdie \"Not a single commit $@\"\n-prev=$(git-rev-parse --verify \"$commit^1\" 2>/dev/null) ||\n+prev=$(git rev-parse --verify -q \"$commit^1\") ||\n \tdie \"Cannot run $me a root commit\"\n-git-rev-parse --verify \"$commit^2\" >/dev/null 2>&1 &&\n+git rev-parse --verify -q \"$commit^2\" >/dev/null &&\n \tdie \"Cannot run $me a multi-parent commit.\"\n \n encoding=$(git config i18n.commitencoding || echo UTF-8)\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 9e03eee..0b13d23 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -573,7 +573,7 @@ sub is_sha1 {\n \n sub get_headref ($) {\n \tmy $name = shift;\n-\tmy $r = `git rev-parse --verify '$name' 2>/dev/null`;\n+\tmy $r = `git rev-parse --verify -q '$name' 2>/dev/null`;\n \treturn undef unless $? == 0;\n \tchomp $r;\n \treturn $r;\ndiff --git a/git-stash.sh b/git-stash.sh\nindex aa47e54..f6bd623 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -39,7 +39,7 @@ clear_stash () {\n \tthen\n \t\tdie \"git stash clear with parameters is unimplemented\"\n \tfi\n-\tif current=$(git rev-parse --verify $ref_stash 2>/dev/null)\n+\tif current=$(git rev-parse --verify -q $ref_stash)\n \tthen\n \t\tgit update-ref -d $ref_stash $current\n \tfi\n@@ -201,7 +201,7 @@ save_stash () {\n }\n \n have_stash () {\n-\tgit rev-parse --verify $ref_stash >/dev/null 2>&1\n+\tgit rev-parse --verify -q $ref_stash >/dev/null\n }\n \n list_stash () {\n@@ -342,16 +342,17 @@ drop_stash () {\n \tfi\n \t# Verify supplied argument looks like a stash entry\n \ts=$(git rev-parse --verify \"$@\") &&\n-\tgit rev-parse --verify \"$s:\"   > /dev/null 2>&1 &&\n-\tgit rev-parse --verify \"$s^1:\" > /dev/null 2>&1 &&\n-\tgit rev-parse --verify \"$s^2:\" > /dev/null 2>&1 ||\n+\tgit rev-parse --verify -q \"$s:\"   > /dev/null &&\n+\tgit rev-parse --verify -q \"$s^1:\" > /dev/null &&\n+\tgit rev-parse --verify -q \"$s^2:\" > /dev/null ||\n \t\tdie \"$*: not a valid stashed state\"\n \n \tgit reflog delete --updateref --rewrite \"$@\" &&\n \t\tsay \"Dropped $* ($s)\" || die \"$*: Could not drop stash entry\"\n \n \t# clear_stash if we just dropped the last stash entry\n-\tgit rev-parse --verify \"$ref_stash@{0}\" > /dev/null 2>&1 || clear_stash\n+\tgit rev-parse --verify -q \"$ref_stash@{0}\" > /dev/null 2>&1 ||\n+\t\tclear_stash\n }\n \n apply_to_branch () {\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 439eefd..a1ebe75 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -7,7 +7,7 @@\n #\n # To enable this hook, rename this file to \"pre-commit\".\n \n-if git-rev-parse --verify HEAD >/dev/null 2>&1\n+if git rev-parse --verify -q HEAD >/dev/null\n then\n \tagainst=HEAD\n else\n-- \n1.7.0.2\n"},{"id":"137464","messageId":"E2F911AD-19C6-43BF-BBBD-735D30885F21@meyerhome.net","threadId":"23098","inReplyTo":"20100321043330.GA9803@progeny.tock","subject":"Re: [PATCH 2/4] pull: use --quiet rather than 2>/dev/null","fromName":"Benjamin Meyer","fromEmail":"ben@meyerhome.net","sentAt":"2010-03-21T17:34:10Z","receivedAt":"2010-03-21T17:34:10Z","isPatch":true,"sender":{"key":"ben@meyerhome.net","avatar":null},"body":"\nOn Mar 21, 2010, at 12:33 AM, Jonathan Nieder wrote:\n\n> Hi again,\n> \n> Benjamin Meyer wrote:\n> \n>> re-checking the other patches I think they are correct in their\n>> usage.\n> \n> Thanks for checking.\n> \n>> I ran the matching tests, the rebase ones passed,\n>> 3903-stash.sh is already failing before my patch and\n>> t3904-stash-patch.sh continues passing with the patch.  Other then\n>> running the tests in t/ is there anything I should do to verify\n>> patches?\n> \n> Regarding testing: the best thing to do IMHO is to explain in the commit\n> message what effect the patch will have.  Then reviewers (including you)\n> can read it and try it out to make sure what you say is true.\n> \n> The test suite is not very good for checking that a patch does what\n> it’s meant to do, but that’s okay, since it has a different purpose [1].\n> \n> As an example of what I mean, here is your patch 1/4 again (untested,\n> though).  I didn’t add any tests since it would be kind of hard to\n> provoke address space exhaustion at just the right moment.\n\n[snip]\n\nThanks for the example.  I will try to include a more full explanation for my changes in the future so it can be more easily reviewed.\n\n-Benjamin Meyer"},{"id":"137605","messageId":"20100323032344.GA12424@progeny.tock","threadId":"23098","inReplyTo":"E2F911AD-19C6-43BF-BBBD-735D30885F21@meyerhome.net","subject":"Re: [PATCH 2/4] pull: use --quiet rather than 2>/dev/null","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-23T03:23:44Z","receivedAt":"2010-03-23T03:23:44Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Benjamin Meyer wrote:\n\n> Thanks for the example.  I will try to include a more full\n> explanation for my changes in the future so it can be more easily\n> reviewed.\n\nThanks for your work!  I got a kick out of reading\n<http://meyerhome.net/icefox/git-achievements>, by the way.\n\nJonathan\n"}]}