git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@freedesktop.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] Remove useless uses of cat, and replace with filename arguments or redirection
Date: Wed, 06 Jun 2007 19:23:49 -0700	[thread overview]
Message-ID: <46676C35.60406@freedesktop.org> (raw)
In-Reply-To: <7vsl94sego.fsf@assigned-by-dhcp.cox.net>

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

Junio C Hamano wrote:
> Josh Triplett <josh@freedesktop.org> 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 <josh@freedesktop.org>
>> ---
>>
>> 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 ;-)?

No, just fixed differently. :) Note the change to the tr invocation: delete
everything other than digits.

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2007-06-07  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06  4:36 [PATCH v2] Remove useless uses of cat, and replace with filename arguments or redirection Josh Triplett
2007-06-07  2:09 ` Junio C Hamano
2007-06-07  2:23   ` Josh Triplett [this message]
2007-06-07  2:52     ` Junio C Hamano
2007-06-07  4:06     ` Johannes Schindelin
2007-06-08 10:42       ` Martin Langhoff
2007-06-08 12:52         ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46676C35.60406@freedesktop.org \
    --to=josh@freedesktop.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).