Skip to contentSkip to conversation

repack: don't report "Nothing new to pack." if -q is given

PATCH In review Uwe Kleine-König 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 repack: don't report "Nothing new to pack." if -q is given

---
This patch is on top of maint. For master and next you need s/name/names/.

Best regards
Uwe

 git-repack.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
git-repack.sh +3 -1
index ddfa8b4..d980275 100755
@@ -65,7 +65,9 @@ args="$args $local $quiet $no_reuse_delta$extra"
 name=$(git-pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
 	exit 1
 if [ -z "$name" ]; then
-	echo Nothing new to pack.
+	if test -q "$quiet"; then
+		echo Nothing new to pack.
+	fi
 else
 	chmod a-w "$PACKTMP-$name.pack"
 	chmod a-w "$PACKTMP-$name.idx"
Signature · 10 lines
1.5.2.2.1451.gb0e5e


-- 
Uwe Kleine-König

exit vi, lesson II:
: w q ! <CR>

NB: write the current file
#1 lore raw
Quoted 16 lines · Uwe Kleine-König

---
This patch is on top of maint. For master and next you need s/name/names/.

Best regards
Uwe

 git-repack.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
git-repack.sh +0 -0
index ddfa8b4..d980275 100755

git-repack.sh args="$args $local $quiet $no_reuse_delta$extra" · line 70

Quoted 7 lines
git-repack.sh +3 -1
@@ -65,7 +65,9 @@ args="$args $local $quiet $no_reuse_delta$extra"
 name=$(git-pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
 	exit 1
 if [ -z "$name" ]; then
-	echo Nothing new to pack.
+	if test -q "$quiet"; then
+		echo Nothing new to pack.
+	fi

This looks wrong, especially as I can't find a '-q' in the manpage of "test". Perhaps you ment something like the following code, which is already used in the script:

	if test "$quiet" != '-q'; then
		echo ...
	fi

-Peter

#2 lore raw

---

Quoted 12 lines · Peter Baumann

Review

Quoted 6 lines · Uwe Kleine-König
(quoted diff) +3 -1
 	exit 1
 if [ -z "$name" ]; then
-	echo Nothing new to pack.
+	if test -q "$quiet"; then
+		echo Nothing new to pack.
+	fi

This looks wrong, especially as I can't find a '-q' in the manpage of "test". Perhaps you ment something like the following code, which is already used in the script:

Quoted 3 lines
	if test "$quiet" != '-q'; then
		echo ...
	fi

actually I meant test -z "$quiet", but test "$quiet" != '-q' would be equally good.

Thanks for noticing.

Uwe

 git-repack.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
git-repack.sh +3 -1
index ddfa8b4..1ce2760 100755
@@ -65,7 +65,9 @@ args="$args $local $quiet $no_reuse_delta$extra"
 name=$(git-pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
 	exit 1
 if [ -z "$name" ]; then
-	echo Nothing new to pack.
+	if test -z "$quiet"; then
+		echo Nothing new to pack.
+	fi
 else
 	chmod a-w "$PACKTMP-$name.pack"
 	chmod a-w "$PACKTMP-$name.idx"
Signature · 1 line
1.5.2.2.1451.gb0e5e
Quoted 15 lines

git-repack.sh args="$args $local $quiet $no_reuse_delta$extra" · line 65

Quoted 12 lines

Best regards
Uwe

 git-repack.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
git-repack.sh +0 -0
index ddfa8b4..d980275 100755
@@ -65,7 +65,9 @@ args="$args $local $quiet $no_reuse_delta$extra"
 name=$(git-pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||

-Peter

Signature · 3 lines
Uwe Kleine-König

$ dc -e "5735816763073014741799356604682P"