From: Tommy M. McGuire Date: Sun, 05 Jun 2005 19:09:38 GMT Subject: Re: cg-init bug -- identified Message-ID: <20050605190938.GB21345@immutable.crsr.net> In-Reply-To: <20050605184341.GA21345@immutable.crsr.net> 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