From: Wolfram Sang <w.sang@pengutronix.de>
To: Dan Carpenter <error27@gmail.com>,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: rename_rev.pl script for reviewing renames
Date: Thu, 3 Feb 2011 11:22:19 +0100 [thread overview]
Message-ID: <20110203102219.GB6508@pengutronix.de> (raw)
In-Reply-To: <20110203100828.GO20606@bicker>
[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]
On Thu, Feb 03, 2011 at 01:08:28PM +0300, Dan Carpenter wrote:
> There are a lot of refactoring patches where people change camel case
> names to kernel style names etc. I've written a script to make it
> easier to review them. It's attached.
Cool, thanks for sharing. I guess my comments won't matter much, here
they are anyway :)
> sub usage() {
> print "cat diff | transform.pl old new old new old new...\n";
Filename of the tool does not match.
> # white space at the end of lines
> $line =~ s/ *$//g;
> $line =~ s/\t*$//g;
Character class here as well? Will also get mixtures of the two.
> while (<>) {
> my $line = $_;
You could work here with plain $_, but I assume you don't do on purpose.
>
> if ($line =~ /^---/) {
> next;
> }
> if ($line =~ /^\+\+\+/) {
> next;
> }
Use an alternation in the regexp?
> my $output = filter($line);
> if ($line =~ /^-/) {
> print $oldfh $output;
> next;
> }
> if ($line =~ /^\+/) {
> print $newfh $output;
> next;
> }
Ditto.
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2011-02-03 10:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 10:08 Dan Carpenter
2011-02-03 10:22 ` Wolfram Sang [this message]
2011-02-03 10:35 ` Dan Carpenter
2011-02-03 10:50 ` Dan Carpenter
2011-02-06 12:25 ` Dan Carpenter
2011-02-07 3:39 ` Joe Perches
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=20110203102219.GB6508@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=devel@driverdev.osuosl.org \
--cc=error27@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®