# [PATCH 2/5] lost-found: use git rev-parse -q

6 messages from 2008-12-03 to 2008-12-03. Participants: Miklos Vajna.
Thread: https://gitlist.dev/t/16579

## Miklos Vajna, 2008-12-03 13:26

Subject: [PATCH 0/5] More "use rev-parse -q" patches
Message-ID: <cover.1228310570.git.vmiklos@frugalware.org>
URL: https://gitlist.dev/e/cover.1228310570.git.vmiklos%40frugalware.org

```
Hi,

I'm sending these as separate patches as they touch completely unrelated
parts of Git, but feel free to squash them together you think that's
better.

All of them is about using rev-parse -q instead of rev-parse 2>/dev/null.

Miklos Vajna (5):
  filter-branch: use git rev-parse -q
  lost-found: use git rev-parse -q
  pull: use git rev-parse -q
  rebase: use git rev-parse -q
  submodule: use git rev-parse -q

 git-filter-branch.sh |    2 +-
 git-lost-found.sh    |    2 +-
 git-pull.sh          |    8 ++++----
 git-rebase.sh        |    4 ++--
 git-submodule.sh     |    6 +++---
 5 files changed, 11 insertions(+), 11 deletions(-)

```

## Miklos Vajna, 2008-12-03 13:26

Subject: [PATCH 1/5] filter-branch: use git rev-parse -q
Message-ID: <4858dc4d5d92276fa96a8fb45b02adaae57dcf26.1228310570.git.vmiklos@frugalware.org>
URL: https://gitlist.dev/e/4858dc4d5d92276fa96a8fb45b02adaae57dcf26.1228310570.git.vmiklos%40frugalware.org
In-Reply-To: <cover.1228310570.git.vmiklos@frugalware.org>

```
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 git-filter-branch.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 81392ad..c106f45 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -256,7 +256,7 @@ while read commit parents; do
 	*)
 		# The commit may not have the subdirectory at all
 		err=$(git read-tree -i -m $commit:"$filter_subdir" 2>&1) || {
-			if ! git rev-parse --verify $commit:"$filter_subdir" 2>/dev/null
+			if ! git rev-parse -q --verify $commit:"$filter_subdir"
 			then
 				rm -f "$GIT_INDEX_FILE"
 			else
-- 
1.6.0.4

```

## Miklos Vajna, 2008-12-03 13:26

Subject: [PATCH 2/5] lost-found: use git rev-parse -q
Message-ID: <73193271279140eda04ec46097936e64f3c526d6.1228310570.git.vmiklos@frugalware.org>
URL: https://gitlist.dev/e/73193271279140eda04ec46097936e64f3c526d6.1228310570.git.vmiklos%40frugalware.org
In-Reply-To: <4858dc4d5d92276fa96a8fb45b02adaae57dcf26.1228310570.git.vmiklos@frugalware.org>

```
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 git-lost-found.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-lost-found.sh b/git-lost-found.sh
index 9cedaf8..0b3e8c7 100755
--- a/git-lost-found.sh
+++ b/git-lost-found.sh
@@ -20,7 +20,7 @@ while read dangling type sha1
 do
 	case "$dangling" in
 	dangling)
-		if git rev-parse --verify "$sha1^0" >/dev/null 2>/dev/null
+		if git rev-parse -q --verify "$sha1^0" >/dev/null
 		then
 			dir="$laf/commit"
 			git show-branch "$sha1"
-- 
1.6.0.4

```

## Miklos Vajna, 2008-12-03 13:26

Subject: [PATCH 3/5] pull: use git rev-parse -q
Message-ID: <8c4e8eda234e8e37d4a7a3ac43ffc7738e6fac4b.1228310570.git.vmiklos@frugalware.org>
URL: https://gitlist.dev/e/8c4e8eda234e8e37d4a7a3ac43ffc7738e6fac4b.1228310570.git.vmiklos%40frugalware.org
In-Reply-To: <73193271279140eda04ec46097936e64f3c526d6.1228310570.git.vmiklos@frugalware.org>

```
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 git-pull.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/git-pull.sh b/git-pull.sh
index 1cac898..2c7f432 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -121,13 +121,13 @@ test true = "$rebase" && {
 	test -z "$origin" && origin=$(get_default_remote)
 	reflist="$(get_remote_refs_for_fetch "$@" 2>/dev/null |
 		sed "s|refs/heads/\(.*\):|\1|")" &&
-	oldremoteref="$(git rev-parse --verify \
-		"refs/remotes/$origin/$reflist" 2>/dev/null)"
+	oldremoteref="$(git rev-parse -q --verify \
+		"refs/remotes/$origin/$reflist")"
 }
-orig_head=$(git rev-parse --verify HEAD 2>/dev/null)
+orig_head=$(git rev-parse -q --verify HEAD)
 git fetch $verbosity --update-head-ok "$@" || exit 1
 
-curr_head=$(git rev-parse --verify HEAD 2>/dev/null)
+curr_head=$(git rev-parse -q --verify HEAD)
 if test -n "$orig_head" && test "$curr_head" != "$orig_head"
 then
 	# The fetch involved updating the current branch.
-- 
1.6.0.4

```

## Miklos Vajna, 2008-12-03 13:26

Subject: [PATCH 4/5] rebase: use git rev-parse -q
Message-ID: <b67238b67501272485cc659c11a836f4f96e0d81.1228310570.git.vmiklos@frugalware.org>
URL: https://gitlist.dev/e/b67238b67501272485cc659c11a836f4f96e0d81.1228310570.git.vmiklos%40frugalware.org
In-Reply-To: <8c4e8eda234e8e37d4a7a3ac43ffc7738e6fac4b.1228310570.git.vmiklos@frugalware.org>

```
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 git-rebase.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 023a6dc..ea7720d 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -365,10 +365,10 @@ case "$#" in
 	switch_to="$2"
 
 	if git show-ref --verify --quiet -- "refs/heads/$2" &&
-	   branch=$(git rev-parse --verify "refs/heads/$2" 2>/dev/null)
+	   branch=$(git rev-parse -q --verify "refs/heads/$2")
 	then
 		head_name="refs/heads/$2"
-	elif branch=$(git rev-parse --verify "$2" 2>/dev/null)
+	elif branch=$(git rev-parse -q --verify "$2")
 	then
 		head_name="detached HEAD"
 	else
-- 
1.6.0.4

```

## Miklos Vajna, 2008-12-03 13:26

Subject: [PATCH 5/5] submodule: use git rev-parse -q
Message-ID: <c3a20382adecc78a12c9cf1bff9beb102d323b5e.1228310570.git.vmiklos@frugalware.org>
URL: https://gitlist.dev/e/c3a20382adecc78a12c9cf1bff9beb102d323b5e.1228310570.git.vmiklos%40frugalware.org
In-Reply-To: <b67238b67501272485cc659c11a836f4f96e0d81.1228310570.git.vmiklos@frugalware.org>

```
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 git-submodule.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index 220d94e..2f47e06 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -413,7 +413,7 @@ cmd_summary() {
 
 	test $summary_limit = 0 && return
 
-	if rev=$(git rev-parse --verify "$1^0" 2>/dev/null)
+	if rev=$(git rev-parse -q --verify "$1^0")
 	then
 		head=$rev
 		shift
@@ -464,11 +464,11 @@ cmd_summary() {
 		missing_dst=
 
 		test $mod_src = 160000 &&
-		! GIT_DIR="$name/.git" git-rev-parse --verify $sha1_src^0 >/dev/null 2>&1 &&
+		! GIT_DIR="$name/.git" git-rev-parse -q --verify $sha1_src^0 >/dev/null &&
 		missing_src=t
 
 		test $mod_dst = 160000 &&
-		! GIT_DIR="$name/.git" git-rev-parse --verify $sha1_dst^0 >/dev/null 2>&1 &&
+		! GIT_DIR="$name/.git" git-rev-parse -q --verify $sha1_dst^0 >/dev/null &&
 		missing_dst=t
 
 		total_commits=
-- 
1.6.0.4

```
