From: Junio C Hamano Date: Thu, 07 Jun 2007 02:09:11 GMT Subject: Re: [PATCH v2] Remove useless uses of cat, and replace with filename arguments or redirection Message-ID: <7vsl94sego.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <466639D0.1040306@freedesktop.org> Josh Triplett writes: > Replace all uses of cat that do nothing other than read a single file. In the > case of git-quilt-import, this occurs once per patch. > > Signed-off-by: Josh Triplett > --- > > This revised version fixes a bug caught by Stephen Rothwell: the output of wc > -l changes when it has a filename on the command line. The same bug occurred > in one other place as well. Hmph... > diff --git a/git-filter-branch.sh b/git-filter-branch.sh > index 0c8a7df..346cf3f 100644 > --- a/git-filter-branch.sh > +++ b/git-filter-branch.sh > @@ -333,7 +333,7 @@ for commit in $unchanged; do > done > > git-rev-list --reverse --topo-order $srcbranch --not $unchanged >../revs > -commits=$(cat ../revs | wc -l | tr -d " ") > +commits=$(wc -l ../revs | tr -d -c 0-9) ... and left unfixed ;-)?