Re: cg-init bug -- identified

From: Tommy M. McGuire <mcguire@crsr.net>
Date: 2005-06-06 05:09:38
On Sun, Jun 05, 2005 at 01:43:41PM -0500, Tommy M. McGuire wrote:
> Adding file foo'prime
> xargs: unmatched single quote
> + cg-commit -C '-mInitial commit' -E
> 
> The error is the second-to-last line.  It partially succeeded originally
> because xargs broke off and handled parts of the input before reaching 
> the single quote.

The bug is in cg-add, which doesn't use -print0 and -0.

-- 
Tommy McGuire

diff --git a/cg-add b/cg-add
--- a/cg-add
+++ b/cg-add
@@ -20,9 +20,9 @@ USAGE="cg-add FILE..."
 [ "$1" ] || usage
 
 TMPFILE=$(mktemp -t gitadd.XXXXXX)
-find "$@" -type f > $TMPFILE || die "not all files exist, nothing added"
+find "$@" -type f -print0 > $TMPFILE || die "not all files exist, nothing added"
 
-cat $TMPFILE | awk '{print "Adding file "  $0}'
-cat $TMPFILE | xargs git-update-cache --add --
+cat $TMPFILE | xargs -0l1 echo "Adding file "
+cat $TMPFILE | xargs -0 git-update-cache --add --
 
 rm $TMPFILE
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Jun 06 05:10:38 2005

This archive was generated by hypermail 2.1.8 : 2005-06-06 05:10:40 EST