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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Uwe Kleine-König <ukleinek@xxxxxxxxxxxxxxxxxxxxxxxxxx>
---
Peter Baumann wrote:
> On Tue, Jul 03, 2007 at 10:47:58AM +0200, Uwe Kleine-König wrote:
> >  	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
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(-)

diff --git a/git-repack.sh b/git-repack.sh
index ddfa8b4..1ce2760 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -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"
-- 
1.5.2.2.1451.gb0e5e



> > Best regards
> > Uwe
> > 
> >  git-repack.sh |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/git-repack.sh b/git-repack.sh
> > index ddfa8b4..d980275 100755
> > --- a/git-repack.sh
> > +++ b/git-repack.sh
> > @@ -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
> 

-- 
Uwe Kleine-König

$ dc -e "5735816763073014741799356604682P"
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux