[{"id":1767189,"web_url":"http://patchwork.ozlabs.org/comment/1767189/","msgid":"<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>","list_archive_url":null,"date":"2017-09-12T15:52:18","subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 12/09/2017 12:46, Daniel P. Berrange wrote:\n> Currently before submitting a series, devs should run checkpatch.pl\n> across each patch to be submitted. This can be automated using a\n> command such as:\n> \n>   git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'\n> \n> This is rather long winded to type, so this patch introduces a new\n> flag '--branch' to checkpatch.pl which instructs it to check every\n> patch on the current GIT branch.\n\nGreat idea, though I'm not sure about having a default.  And to keep it\neasy to invoke, having a sole argument that ends with \"..\" might DWIM\nand enable --branch too...\n\nPaolo\n\n> For example:\n> \n>     $ ./scripts/checkpatch.pl --branch\n>     total: 0 errors, 0 warnings, 297 lines checked\n> \n>     b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.\n>     total: 0 errors, 0 warnings, 182 lines checked\n> \n>     2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.\n>     total: 0 errors, 0 warnings, 102 lines checked\n> \n>     11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.\n> \n> By default it checks every patch identified by 'master..', however,\n> an alternative origin can be given if desired, if the current branch\n> is rebased to another non-master branch:\n> \n>     $ ./scripts/checkpatch.pl --branch somebranch..\n> \n> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n> ---\n>  scripts/checkpatch.pl | 97 +++++++++++++++++++++++++++++++++++++--------------\n>  1 file changed, 71 insertions(+), 26 deletions(-)\n> \n> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl\n> index fa478074b8..f8d080441f 100755\n> --- a/scripts/checkpatch.pl\n> +++ b/scripts/checkpatch.pl\n> @@ -19,6 +19,8 @@ my $quiet = 0;\n>  my $tree = 1;\n>  my $chk_signoff = 1;\n>  my $chk_patch = 1;\n> +my $chk_branch = 0;\n> +my $revlist = \"master..\";\n>  my $tst_only;\n>  my $emacs = 0;\n>  my $terse = 0;\n> @@ -43,6 +45,7 @@ Options:\n>    --no-tree                  run without a kernel tree\n>    --no-signoff               do not check for 'Signed-off-by' line\n>    --patch                    treat FILE as patchfile (default)\n> +  --branch                   check all patches on branch since master\n>    --emacs                    emacs compile window format\n>    --terse                    one line per report\n>    -f, --file                 treat FILE as regular source file\n> @@ -69,6 +72,7 @@ GetOptions(\n>  \t'tree!'\t\t=> \\$tree,\n>  \t'signoff!'\t=> \\$chk_signoff,\n>  \t'patch!'\t=> \\$chk_patch,\n> +\t'branch'\t=> \\$chk_branch,\n>  \t'emacs!'\t=> \\$emacs,\n>  \t'terse!'\t=> \\$terse,\n>  \t'f|file!'\t=> \\$file,\n> @@ -88,9 +92,19 @@ help(0) if ($help);\n>  \n>  my $exit = 0;\n>  \n> -if ($#ARGV < 0) {\n> -\tprint \"$P: no input files\\n\";\n> -\texit(1);\n> +if ($chk_branch) {\n> +\tif ($#ARGV > 0) {\n> +\t\tprint \"$P: expected zero or one origni revisions\\n\";\n> +\t\texit(1);\n> +\t}\n> +\tif ($#ARGV == 0) {\n> +\t\t$revlist = shift @ARGV;\n> +\t}\n> +} else {\n> +\tif ($#ARGV < 0) {\n> +\t\tprint \"$P: no input files\\n\";\n> +\t\texit(1);\n> +\t}\n>  }\n>  \n>  my $dbg_values = 0;\n> @@ -251,32 +265,63 @@ $chk_signoff = 0 if ($file);\n>  my @rawlines = ();\n>  my @lines = ();\n>  my $vname;\n> -for my $filename (@ARGV) {\n> -\tmy $FILE;\n> -\tif ($file) {\n> -\t\topen($FILE, '-|', \"diff -u /dev/null $filename\") ||\n> -\t\t\tdie \"$P: $filename: diff failed - $!\\n\";\n> -\t} elsif ($filename eq '-') {\n> -\t\topen($FILE, '<&STDIN');\n> -\t} else {\n> -\t\topen($FILE, '<', \"$filename\") ||\n> -\t\t\tdie \"$P: $filename: open failed - $!\\n\";\n> -\t}\n> -\tif ($filename eq '-') {\n> -\t\t$vname = 'Your patch';\n> -\t} else {\n> -\t\t$vname = $filename;\n> -\t}\n> -\twhile (<$FILE>) {\n> +if ($chk_branch) {\n> +\tmy @patches;\n> +\tmy $HASH;\n> +\topen($HASH, \"-|\", \"git\", \"log\", \"--format=%H\", $revlist) ||\n> +\t\tdie \"$P: git log --format=%H $revlist failed - $!\\n\";\n> +\n> +\twhile (<$HASH>) {\n>  \t\tchomp;\n> -\t\tpush(@rawlines, $_);\n> +\t\tpush @patches, $_;\n>  \t}\n> -\tclose($FILE);\n> -\tif (!process($filename)) {\n> -\t\t$exit = 1;\n> +\n> +\tclose $HASH;\n> +\n> +\tfor my $hash (@patches) {\n> +\t\tmy $FILE;\n> +\t\topen($FILE, '-|', \"git\", \"show\", $hash) ||\n> +\t\t\tdie \"$P: git show $hash - $!\\n\";\n> +\t\t$vname = $hash;\n> +\t\twhile (<$FILE>) {\n> +\t\t\tchomp;\n> +\t\t\tpush(@rawlines, $_);\n> +\t\t}\n> +\t\tclose($FILE);\n> +\t\tif (!process($hash)) {\n> +\t\t\t$exit = 1;\n> +\t\t}\n> +\t\t@rawlines = ();\n> +\t\t@lines = ();\n> +\t}\n> +} else {\n> +\tfor my $filename (@ARGV) {\n> +\t\tmy $FILE;\n> +\t\tif ($file) {\n> +\t\t\topen($FILE, '-|', \"diff -u /dev/null $filename\") ||\n> +\t\t\t\tdie \"$P: $filename: diff failed - $!\\n\";\n> +\t\t} elsif ($filename eq '-') {\n> +\t\t\topen($FILE, '<&STDIN');\n> +\t\t} else {\n> +\t\t\topen($FILE, '<', \"$filename\") ||\n> +\t\t\t\tdie \"$P: $filename: open failed - $!\\n\";\n> +\t\t}\n> +\t\tif ($filename eq '-') {\n> +\t\t\t$vname = 'Your patch';\n> +\t\t} else {\n> +\t\t\t$vname = $filename;\n> +\t\t}\n> +\t\twhile (<$FILE>) {\n> +\t\t\tchomp;\n> +\t\t\tpush(@rawlines, $_);\n> +\t\t}\n> +\t\tclose($FILE);\n> +\t\tif (!process($filename)) {\n> +\t\t\t$exit = 1;\n> +\t\t}\n> +\t\t@rawlines = ();\n> +\t\t@lines = ();\n>  \t}\n> -\t@rawlines = ();\n> -\t@lines = ();\n>  }\n>  \n>  exit($exit);\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs8TW0dslz9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 01:53:13 +1000 (AEST)","from localhost ([::1]:36615 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drnUr-0007KS-Bq\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 11:53:09 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53191)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drnUL-0007Hz-4e\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 11:52:38 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drnUH-0006Hk-4W\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 11:52:37 -0400","from mx1.redhat.com ([209.132.183.28]:41141)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1drnUG-0006GE-RW\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 11:52:33 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id BB7A48553C\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 15:52:31 +0000 (UTC)","from [10.36.117.43] (ovpn-117-43.ams2.redhat.com [10.36.117.43])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id C6DB277DE0;\n\tTue, 12 Sep 2017 15:52:29 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com BB7A48553C","To":"\"Daniel P. Berrange\" <berrange@redhat.com>, qemu-devel@nongnu.org","References":"<20170912104626.8386-1-berrange@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>","Date":"Tue, 12 Sep 2017 17:52:18 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170912104626.8386-1-berrange@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 12 Sep 2017 15:52:31 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Markus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767210,"web_url":"http://patchwork.ozlabs.org/comment/1767210/","msgid":"<20170912161252.GM17633@redhat.com>","list_archive_url":null,"date":"2017-09-12T16:12:52","subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Tue, Sep 12, 2017 at 05:52:18PM +0200, Paolo Bonzini wrote:\n> On 12/09/2017 12:46, Daniel P. Berrange wrote:\n> > Currently before submitting a series, devs should run checkpatch.pl\n> > across each patch to be submitted. This can be automated using a\n> > command such as:\n> > \n> >   git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'\n> > \n> > This is rather long winded to type, so this patch introduces a new\n> > flag '--branch' to checkpatch.pl which instructs it to check every\n> > patch on the current GIT branch.\n> \n> Great idea, though I'm not sure about having a default.  And to keep it\n> easy to invoke, having a sole argument that ends with \"..\" might DWIM\n> and enable --branch too...\n\nI think it is beneficial to have a default, as I figure the majority\nof contributors are working on a branch that's rebased against master..\nHalf as many characters to type in the common case :-)\n\nSometimes people might write patches against a particular subsystem\nstaging branch (eg kevin/block), but I don't think there's downside\nin assuming 'master..' by default.\n\n> \n> Paolo\n> \n> > For example:\n> > \n> >     $ ./scripts/checkpatch.pl --branch\n> >     total: 0 errors, 0 warnings, 297 lines checked\n> > \n> >     b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.\n> >     total: 0 errors, 0 warnings, 182 lines checked\n> > \n> >     2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.\n> >     total: 0 errors, 0 warnings, 102 lines checked\n> > \n> >     11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.\n> > \n> > By default it checks every patch identified by 'master..', however,\n> > an alternative origin can be given if desired, if the current branch\n> > is rebased to another non-master branch:\n> > \n> >     $ ./scripts/checkpatch.pl --branch somebranch..\n> > \n> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n> > ---\n> >  scripts/checkpatch.pl | 97 +++++++++++++++++++++++++++++++++++++--------------\n> >  1 file changed, 71 insertions(+), 26 deletions(-)\n> > \n> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl\n> > index fa478074b8..f8d080441f 100755\n> > --- a/scripts/checkpatch.pl\n> > +++ b/scripts/checkpatch.pl\n> > @@ -19,6 +19,8 @@ my $quiet = 0;\n> >  my $tree = 1;\n> >  my $chk_signoff = 1;\n> >  my $chk_patch = 1;\n> > +my $chk_branch = 0;\n> > +my $revlist = \"master..\";\n> >  my $tst_only;\n> >  my $emacs = 0;\n> >  my $terse = 0;\n> > @@ -43,6 +45,7 @@ Options:\n> >    --no-tree                  run without a kernel tree\n> >    --no-signoff               do not check for 'Signed-off-by' line\n> >    --patch                    treat FILE as patchfile (default)\n> > +  --branch                   check all patches on branch since master\n> >    --emacs                    emacs compile window format\n> >    --terse                    one line per report\n> >    -f, --file                 treat FILE as regular source file\n> > @@ -69,6 +72,7 @@ GetOptions(\n> >  \t'tree!'\t\t=> \\$tree,\n> >  \t'signoff!'\t=> \\$chk_signoff,\n> >  \t'patch!'\t=> \\$chk_patch,\n> > +\t'branch'\t=> \\$chk_branch,\n> >  \t'emacs!'\t=> \\$emacs,\n> >  \t'terse!'\t=> \\$terse,\n> >  \t'f|file!'\t=> \\$file,\n> > @@ -88,9 +92,19 @@ help(0) if ($help);\n> >  \n> >  my $exit = 0;\n> >  \n> > -if ($#ARGV < 0) {\n> > -\tprint \"$P: no input files\\n\";\n> > -\texit(1);\n> > +if ($chk_branch) {\n> > +\tif ($#ARGV > 0) {\n> > +\t\tprint \"$P: expected zero or one origni revisions\\n\";\n> > +\t\texit(1);\n> > +\t}\n> > +\tif ($#ARGV == 0) {\n> > +\t\t$revlist = shift @ARGV;\n> > +\t}\n> > +} else {\n> > +\tif ($#ARGV < 0) {\n> > +\t\tprint \"$P: no input files\\n\";\n> > +\t\texit(1);\n> > +\t}\n> >  }\n> >  \n> >  my $dbg_values = 0;\n> > @@ -251,32 +265,63 @@ $chk_signoff = 0 if ($file);\n> >  my @rawlines = ();\n> >  my @lines = ();\n> >  my $vname;\n> > -for my $filename (@ARGV) {\n> > -\tmy $FILE;\n> > -\tif ($file) {\n> > -\t\topen($FILE, '-|', \"diff -u /dev/null $filename\") ||\n> > -\t\t\tdie \"$P: $filename: diff failed - $!\\n\";\n> > -\t} elsif ($filename eq '-') {\n> > -\t\topen($FILE, '<&STDIN');\n> > -\t} else {\n> > -\t\topen($FILE, '<', \"$filename\") ||\n> > -\t\t\tdie \"$P: $filename: open failed - $!\\n\";\n> > -\t}\n> > -\tif ($filename eq '-') {\n> > -\t\t$vname = 'Your patch';\n> > -\t} else {\n> > -\t\t$vname = $filename;\n> > -\t}\n> > -\twhile (<$FILE>) {\n> > +if ($chk_branch) {\n> > +\tmy @patches;\n> > +\tmy $HASH;\n> > +\topen($HASH, \"-|\", \"git\", \"log\", \"--format=%H\", $revlist) ||\n> > +\t\tdie \"$P: git log --format=%H $revlist failed - $!\\n\";\n> > +\n> > +\twhile (<$HASH>) {\n> >  \t\tchomp;\n> > -\t\tpush(@rawlines, $_);\n> > +\t\tpush @patches, $_;\n> >  \t}\n> > -\tclose($FILE);\n> > -\tif (!process($filename)) {\n> > -\t\t$exit = 1;\n> > +\n> > +\tclose $HASH;\n> > +\n> > +\tfor my $hash (@patches) {\n> > +\t\tmy $FILE;\n> > +\t\topen($FILE, '-|', \"git\", \"show\", $hash) ||\n> > +\t\t\tdie \"$P: git show $hash - $!\\n\";\n> > +\t\t$vname = $hash;\n> > +\t\twhile (<$FILE>) {\n> > +\t\t\tchomp;\n> > +\t\t\tpush(@rawlines, $_);\n> > +\t\t}\n> > +\t\tclose($FILE);\n> > +\t\tif (!process($hash)) {\n> > +\t\t\t$exit = 1;\n> > +\t\t}\n> > +\t\t@rawlines = ();\n> > +\t\t@lines = ();\n> > +\t}\n> > +} else {\n> > +\tfor my $filename (@ARGV) {\n> > +\t\tmy $FILE;\n> > +\t\tif ($file) {\n> > +\t\t\topen($FILE, '-|', \"diff -u /dev/null $filename\") ||\n> > +\t\t\t\tdie \"$P: $filename: diff failed - $!\\n\";\n> > +\t\t} elsif ($filename eq '-') {\n> > +\t\t\topen($FILE, '<&STDIN');\n> > +\t\t} else {\n> > +\t\t\topen($FILE, '<', \"$filename\") ||\n> > +\t\t\t\tdie \"$P: $filename: open failed - $!\\n\";\n> > +\t\t}\n> > +\t\tif ($filename eq '-') {\n> > +\t\t\t$vname = 'Your patch';\n> > +\t\t} else {\n> > +\t\t\t$vname = $filename;\n> > +\t\t}\n> > +\t\twhile (<$FILE>) {\n> > +\t\t\tchomp;\n> > +\t\t\tpush(@rawlines, $_);\n> > +\t\t}\n> > +\t\tclose($FILE);\n> > +\t\tif (!process($filename)) {\n> > +\t\t\t$exit = 1;\n> > +\t\t}\n> > +\t\t@rawlines = ();\n> > +\t\t@lines = ();\n> >  \t}\n> > -\t@rawlines = ();\n> > -\t@lines = ();\n> >  }\n> >  \n> >  exit($exit);\n> > \n> \n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs8wv5zlDz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 02:13:35 +1000 (AEST)","from localhost ([::1]:36828 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drnob-0001rU-Tu\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 12:13:33 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33304)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1drno3-0001pV-HN\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:13:01 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1drno0-00017x-S2\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:12:59 -0400","from mx1.redhat.com ([209.132.183.28]:42855)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1drno0-000179-If\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:12:56 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 886DF85543\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 16:12:55 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id D69F96FA84;\n\tTue, 12 Sep 2017 16:12:54 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 886DF85543","Date":"Tue, 12 Sep 2017 17:12:52 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170912161252.GM17633@redhat.com>","References":"<20170912104626.8386-1-berrange@redhat.com>\n\t<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 12 Sep 2017 16:12:55 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767212,"web_url":"http://patchwork.ozlabs.org/comment/1767212/","msgid":"<5994d2c2-77b3-6698-c9e0-c737c84caf68@redhat.com>","list_archive_url":null,"date":"2017-09-12T16:14:57","subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 12/09/2017 18:12, Daniel P. Berrange wrote:\n> On Tue, Sep 12, 2017 at 05:52:18PM +0200, Paolo Bonzini wrote:\n>> On 12/09/2017 12:46, Daniel P. Berrange wrote:\n>>> Currently before submitting a series, devs should run checkpatch.pl\n>>> across each patch to be submitted. This can be automated using a\n>>> command such as:\n>>>\n>>>   git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'\n>>>\n>>> This is rather long winded to type, so this patch introduces a new\n>>> flag '--branch' to checkpatch.pl which instructs it to check every\n>>> patch on the current GIT branch.\n>>\n>> Great idea, though I'm not sure about having a default.  And to keep it\n>> easy to invoke, having a sole argument that ends with \"..\" might DWIM\n>> and enable --branch too...\n> \n> I think it is beneficial to have a default, as I figure the majority\n> of contributors are working on a branch that's rebased against master..\n> Half as many characters to type in the common case :-)\n\nWith the DWIM option \"--branch\" and \"master..\" are exactly the same\nlength. :)\n\n> Sometimes people might write patches against a particular subsystem\n> staging branch (eg kevin/block), but I don't think there's downside\n> in assuming 'master..' by default.\n\nWhat about \"origin/master..\" instead?\n\nPaolo\n\n>>\n>> Paolo\n>>\n>>> For example:\n>>>\n>>>     $ ./scripts/checkpatch.pl --branch\n>>>     total: 0 errors, 0 warnings, 297 lines checked\n>>>\n>>>     b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.\n>>>     total: 0 errors, 0 warnings, 182 lines checked\n>>>\n>>>     2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.\n>>>     total: 0 errors, 0 warnings, 102 lines checked\n>>>\n>>>     11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.\n>>>\n>>> By default it checks every patch identified by 'master..', however,\n>>> an alternative origin can be given if desired, if the current branch\n>>> is rebased to another non-master branch:\n>>>\n>>>     $ ./scripts/checkpatch.pl --branch somebranch..\n>>>\n>>> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n>>> ---\n>>>  scripts/checkpatch.pl | 97 +++++++++++++++++++++++++++++++++++++--------------\n>>>  1 file changed, 71 insertions(+), 26 deletions(-)\n>>>\n>>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl\n>>> index fa478074b8..f8d080441f 100755\n>>> --- a/scripts/checkpatch.pl\n>>> +++ b/scripts/checkpatch.pl\n>>> @@ -19,6 +19,8 @@ my $quiet = 0;\n>>>  my $tree = 1;\n>>>  my $chk_signoff = 1;\n>>>  my $chk_patch = 1;\n>>> +my $chk_branch = 0;\n>>> +my $revlist = \"master..\";\n>>>  my $tst_only;\n>>>  my $emacs = 0;\n>>>  my $terse = 0;\n>>> @@ -43,6 +45,7 @@ Options:\n>>>    --no-tree                  run without a kernel tree\n>>>    --no-signoff               do not check for 'Signed-off-by' line\n>>>    --patch                    treat FILE as patchfile (default)\n>>> +  --branch                   check all patches on branch since master\n>>>    --emacs                    emacs compile window format\n>>>    --terse                    one line per report\n>>>    -f, --file                 treat FILE as regular source file\n>>> @@ -69,6 +72,7 @@ GetOptions(\n>>>  \t'tree!'\t\t=> \\$tree,\n>>>  \t'signoff!'\t=> \\$chk_signoff,\n>>>  \t'patch!'\t=> \\$chk_patch,\n>>> +\t'branch'\t=> \\$chk_branch,\n>>>  \t'emacs!'\t=> \\$emacs,\n>>>  \t'terse!'\t=> \\$terse,\n>>>  \t'f|file!'\t=> \\$file,\n>>> @@ -88,9 +92,19 @@ help(0) if ($help);\n>>>  \n>>>  my $exit = 0;\n>>>  \n>>> -if ($#ARGV < 0) {\n>>> -\tprint \"$P: no input files\\n\";\n>>> -\texit(1);\n>>> +if ($chk_branch) {\n>>> +\tif ($#ARGV > 0) {\n>>> +\t\tprint \"$P: expected zero or one origni revisions\\n\";\n>>> +\t\texit(1);\n>>> +\t}\n>>> +\tif ($#ARGV == 0) {\n>>> +\t\t$revlist = shift @ARGV;\n>>> +\t}\n>>> +} else {\n>>> +\tif ($#ARGV < 0) {\n>>> +\t\tprint \"$P: no input files\\n\";\n>>> +\t\texit(1);\n>>> +\t}\n>>>  }\n>>>  \n>>>  my $dbg_values = 0;\n>>> @@ -251,32 +265,63 @@ $chk_signoff = 0 if ($file);\n>>>  my @rawlines = ();\n>>>  my @lines = ();\n>>>  my $vname;\n>>> -for my $filename (@ARGV) {\n>>> -\tmy $FILE;\n>>> -\tif ($file) {\n>>> -\t\topen($FILE, '-|', \"diff -u /dev/null $filename\") ||\n>>> -\t\t\tdie \"$P: $filename: diff failed - $!\\n\";\n>>> -\t} elsif ($filename eq '-') {\n>>> -\t\topen($FILE, '<&STDIN');\n>>> -\t} else {\n>>> -\t\topen($FILE, '<', \"$filename\") ||\n>>> -\t\t\tdie \"$P: $filename: open failed - $!\\n\";\n>>> -\t}\n>>> -\tif ($filename eq '-') {\n>>> -\t\t$vname = 'Your patch';\n>>> -\t} else {\n>>> -\t\t$vname = $filename;\n>>> -\t}\n>>> -\twhile (<$FILE>) {\n>>> +if ($chk_branch) {\n>>> +\tmy @patches;\n>>> +\tmy $HASH;\n>>> +\topen($HASH, \"-|\", \"git\", \"log\", \"--format=%H\", $revlist) ||\n>>> +\t\tdie \"$P: git log --format=%H $revlist failed - $!\\n\";\n>>> +\n>>> +\twhile (<$HASH>) {\n>>>  \t\tchomp;\n>>> -\t\tpush(@rawlines, $_);\n>>> +\t\tpush @patches, $_;\n>>>  \t}\n>>> -\tclose($FILE);\n>>> -\tif (!process($filename)) {\n>>> -\t\t$exit = 1;\n>>> +\n>>> +\tclose $HASH;\n>>> +\n>>> +\tfor my $hash (@patches) {\n>>> +\t\tmy $FILE;\n>>> +\t\topen($FILE, '-|', \"git\", \"show\", $hash) ||\n>>> +\t\t\tdie \"$P: git show $hash - $!\\n\";\n>>> +\t\t$vname = $hash;\n>>> +\t\twhile (<$FILE>) {\n>>> +\t\t\tchomp;\n>>> +\t\t\tpush(@rawlines, $_);\n>>> +\t\t}\n>>> +\t\tclose($FILE);\n>>> +\t\tif (!process($hash)) {\n>>> +\t\t\t$exit = 1;\n>>> +\t\t}\n>>> +\t\t@rawlines = ();\n>>> +\t\t@lines = ();\n>>> +\t}\n>>> +} else {\n>>> +\tfor my $filename (@ARGV) {\n>>> +\t\tmy $FILE;\n>>> +\t\tif ($file) {\n>>> +\t\t\topen($FILE, '-|', \"diff -u /dev/null $filename\") ||\n>>> +\t\t\t\tdie \"$P: $filename: diff failed - $!\\n\";\n>>> +\t\t} elsif ($filename eq '-') {\n>>> +\t\t\topen($FILE, '<&STDIN');\n>>> +\t\t} else {\n>>> +\t\t\topen($FILE, '<', \"$filename\") ||\n>>> +\t\t\t\tdie \"$P: $filename: open failed - $!\\n\";\n>>> +\t\t}\n>>> +\t\tif ($filename eq '-') {\n>>> +\t\t\t$vname = 'Your patch';\n>>> +\t\t} else {\n>>> +\t\t\t$vname = $filename;\n>>> +\t\t}\n>>> +\t\twhile (<$FILE>) {\n>>> +\t\t\tchomp;\n>>> +\t\t\tpush(@rawlines, $_);\n>>> +\t\t}\n>>> +\t\tclose($FILE);\n>>> +\t\tif (!process($filename)) {\n>>> +\t\t\t$exit = 1;\n>>> +\t\t}\n>>> +\t\t@rawlines = ();\n>>> +\t\t@lines = ();\n>>>  \t}\n>>> -\t@rawlines = ();\n>>> -\t@lines = ();\n>>>  }\n>>>  \n>>>  exit($exit);\n>>>\n>>\n> \n> Regards,\n> Daniel\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs8zV1N6Gz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 02:15:50 +1000 (AEST)","from localhost ([::1]:36846 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drnqm-0003xK-AA\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 12:15:48 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:34198)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drnqK-0003vH-2h\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:15:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drnqD-0002EN-Tj\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:15:20 -0400","from mx1.redhat.com ([209.132.183.28]:35418)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1drnqD-0002Ds-Js\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:15:13 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id B85A381E09\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 16:15:12 +0000 (UTC)","from [10.36.117.43] (ovpn-117-43.ams2.redhat.com [10.36.117.43])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 43D9E6F42F;\n\tTue, 12 Sep 2017 16:15:05 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B85A381E09","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","References":"<20170912104626.8386-1-berrange@redhat.com>\n\t<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>\n\t<20170912161252.GM17633@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<5994d2c2-77b3-6698-c9e0-c737c84caf68@redhat.com>","Date":"Tue, 12 Sep 2017 18:14:57 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170912161252.GM17633@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tTue, 12 Sep 2017 16:15:12 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767223,"web_url":"http://patchwork.ozlabs.org/comment/1767223/","msgid":"<20170912162223.GN17633@redhat.com>","list_archive_url":null,"date":"2017-09-12T16:22:23","subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Tue, Sep 12, 2017 at 06:14:57PM +0200, Paolo Bonzini wrote:\n> On 12/09/2017 18:12, Daniel P. Berrange wrote:\n> > On Tue, Sep 12, 2017 at 05:52:18PM +0200, Paolo Bonzini wrote:\n> >> On 12/09/2017 12:46, Daniel P. Berrange wrote:\n> >>> Currently before submitting a series, devs should run checkpatch.pl\n> >>> across each patch to be submitted. This can be automated using a\n> >>> command such as:\n> >>>\n> >>>   git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'\n> >>>\n> >>> This is rather long winded to type, so this patch introduces a new\n> >>> flag '--branch' to checkpatch.pl which instructs it to check every\n> >>> patch on the current GIT branch.\n> >>\n> >> Great idea, though I'm not sure about having a default.  And to keep it\n> >> easy to invoke, having a sole argument that ends with \"..\" might DWIM\n> >> and enable --branch too...\n> > \n> > I think it is beneficial to have a default, as I figure the majority\n> > of contributors are working on a branch that's rebased against master..\n> > Half as many characters to type in the common case :-)\n> \n> With the DWIM option \"--branch\" and \"master..\" are exactly the same\n> length. :)\n\nOh hang on. I think I misunderstood what you suggested. I thought you\nmeant  'checkpatch.pl --branch master..', but IIUC you actually mean\n'checkpatch.pl master..' with no flag. That would work with me.\n\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs9840Drgz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 02:23:12 +1000 (AEST)","from localhost ([::1]:36869 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drnxu-0007gz-Qc\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 12:23:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36388)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1drnxE-0007fC-P3\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:22:29 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1drnxD-0005Si-Ls\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:22:28 -0400","from mx1.redhat.com ([209.132.183.28]:41180)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1drnxD-0005SF-FJ\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:22:27 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 8B203C0587D9\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 16:22:26 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id DCBDE6683C;\n\tTue, 12 Sep 2017 16:22:25 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 8B203C0587D9","Date":"Tue, 12 Sep 2017 17:22:23 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<20170912162223.GN17633@redhat.com>","References":"<20170912104626.8386-1-berrange@redhat.com>\n\t<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>\n\t<20170912161252.GM17633@redhat.com>\n\t<5994d2c2-77b3-6698-c9e0-c737c84caf68@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<5994d2c2-77b3-6698-c9e0-c737c84caf68@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tTue, 12 Sep 2017 16:22:26 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767225,"web_url":"http://patchwork.ozlabs.org/comment/1767225/","msgid":"<76f6207d-165d-d1dd-652f-67038e9f2509@redhat.com>","list_archive_url":null,"date":"2017-09-12T16:24:22","subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 12/09/2017 18:22, Daniel P. Berrange wrote:\n> On Tue, Sep 12, 2017 at 06:14:57PM +0200, Paolo Bonzini wrote:\n>> On 12/09/2017 18:12, Daniel P. Berrange wrote:\n>>> On Tue, Sep 12, 2017 at 05:52:18PM +0200, Paolo Bonzini wrote:\n>>>> On 12/09/2017 12:46, Daniel P. Berrange wrote:\n>>>>> Currently before submitting a series, devs should run checkpatch.pl\n>>>>> across each patch to be submitted. This can be automated using a\n>>>>> command such as:\n>>>>>\n>>>>>   git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'\n>>>>>\n>>>>> This is rather long winded to type, so this patch introduces a new\n>>>>> flag '--branch' to checkpatch.pl which instructs it to check every\n>>>>> patch on the current GIT branch.\n>>>>\n>>>> Great idea, though I'm not sure about having a default.  And to keep it\n>>>> easy to invoke, having a sole argument that ends with \"..\" might DWIM\n>>>> and enable --branch too...\n>>>\n>>> I think it is beneficial to have a default, as I figure the majority\n>>> of contributors are working on a branch that's rebased against master..\n>>> Half as many characters to type in the common case :-)\n>>\n>> With the DWIM option \"--branch\" and \"master..\" are exactly the same\n>> length. :)\n> \n> Oh hang on. I think I misunderstood what you suggested. I thought you\n> meant  'checkpatch.pl --branch master..', but IIUC you actually mean\n> 'checkpatch.pl master..' with no flag. That would work with me.\n\nYes, basically if length(argv) == 1 and argv[0] ends with \"..\" then\nenable branch.  The default for --branch with no ARGV could be\n\"origin/master..\"---or it could ask git-config for the upstream tracking\nbranch but maybe that's too much to ask.\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs9B7550Lz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 02:25:03 +1000 (AEST)","from localhost ([::1]:36879 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drnzh-00019b-Qz\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 12:25:01 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37210)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drnzI-000168-Rw\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:24:37 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drnzH-0006Uy-Rl\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:24:36 -0400","from mx1.redhat.com ([209.132.183.28]:59898)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1drnzH-0006Ug-Kv\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 12:24:35 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id AED454E028\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 16:24:34 +0000 (UTC)","from [10.36.117.43] (ovpn-117-43.ams2.redhat.com [10.36.117.43])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 49DA660C20;\n\tTue, 12 Sep 2017 16:24:29 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com AED454E028","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","References":"<20170912104626.8386-1-berrange@redhat.com>\n\t<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>\n\t<20170912161252.GM17633@redhat.com>\n\t<5994d2c2-77b3-6698-c9e0-c737c84caf68@redhat.com>\n\t<20170912162223.GN17633@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<76f6207d-165d-d1dd-652f-67038e9f2509@redhat.com>","Date":"Tue, 12 Sep 2017 18:24:22 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170912162223.GN17633@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tTue, 12 Sep 2017 16:24:34 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767273,"web_url":"http://patchwork.ozlabs.org/comment/1767273/","msgid":"<55d31a10-5e02-e7a9-5e0a-0d84453e1d79@redhat.com>","list_archive_url":null,"date":"2017-09-12T18:05:40","subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","submitter":{"id":64343,"url":"http://patchwork.ozlabs.org/api/people/64343/","name":"John Snow","email":"jsnow@redhat.com"},"content":"On 09/12/2017 12:24 PM, Paolo Bonzini wrote:\n> On 12/09/2017 18:22, Daniel P. Berrange wrote:\n>> On Tue, Sep 12, 2017 at 06:14:57PM +0200, Paolo Bonzini wrote:\n>>> On 12/09/2017 18:12, Daniel P. Berrange wrote:\n>>>> On Tue, Sep 12, 2017 at 05:52:18PM +0200, Paolo Bonzini wrote:\n>>>>> On 12/09/2017 12:46, Daniel P. Berrange wrote:\n>>>>>> Currently before submitting a series, devs should run checkpatch.pl\n>>>>>> across each patch to be submitted. This can be automated using a\n>>>>>> command such as:\n>>>>>>\n>>>>>>   git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'\n>>>>>>\n>>>>>> This is rather long winded to type, so this patch introduces a new\n>>>>>> flag '--branch' to checkpatch.pl which instructs it to check every\n>>>>>> patch on the current GIT branch.\n>>>>>\n>>>>> Great idea, though I'm not sure about having a default.  And to keep it\n>>>>> easy to invoke, having a sole argument that ends with \"..\" might DWIM\n>>>>> and enable --branch too...\n>>>>\n>>>> I think it is beneficial to have a default, as I figure the majority\n>>>> of contributors are working on a branch that's rebased against master..\n>>>> Half as many characters to type in the common case :-)\n>>>\n>>> With the DWIM option \"--branch\" and \"master..\" are exactly the same\n>>> length. :)\n>>\n>> Oh hang on. I think I misunderstood what you suggested. I thought you\n>> meant  'checkpatch.pl --branch master..', but IIUC you actually mean\n>> 'checkpatch.pl master..' with no flag. That would work with me.\n> \n> Yes, basically if length(argv) == 1 and argv[0] ends with \"..\" then\n> enable branch.  The default for --branch with no ARGV could be\n> \"origin/master..\"---or it could ask git-config for the upstream tracking\n> branch but maybe that's too much to ask.\n> \n> Paolo\n> \n\n~Crazy suggestion~ is that the default could actually be \"@{upstream}..\"\nwhich will default to whatever you've configured the upstream to be in\nthe branch you're working in.\n\nDownside is that if you don't set the tracking branch during branch\ncreation (`git checkout -b myTopic origin/master`) or at a later date\n(`git branch --set-upstream-to=origin/master`) that this reference won't\nresolve.\n\nYou can check and see if it resolves to anything programmatically, though:\n\njhuston@probe (review) ~/s/qemu> git rev-parse \"@{upstream}\"\n04ef33052c205170c92df21ca0b4be4f3b102188\njhuston@probe (review) ~/s/qemu> echo $status\n0\n\n\njhuston@probe (master) ~/s/qemu> git checkout -b foobar\nSwitched to a new branch 'foobar'\njhuston@probe (foobar) ~/s/qemu> git rev-parse \"@{upstream}\"\nfatal: no upstream configured for branch 'foobar'\njhuston@probe (foobar) ~/s/qemu> echo $status\n128","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jsnow@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsCQp45lTz9s0g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 04:06:08 +1000 (AEST)","from localhost ([::1]:37904 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drpZV-0006sT-Rz\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 14:06:05 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39377)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1drpZC-0006s9-Vs\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 14:05:48 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1drpZ9-0002Gb-Ho\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 14:05:46 -0400","from mx1.redhat.com ([209.132.183.28]:48090)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <jsnow@redhat.com>) id 1drpZ9-0002FH-2m\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 14:05:43 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id DD4572F14A7\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 18:05:41 +0000 (UTC)","from [10.18.17.231] (dhcp-17-231.bos.redhat.com [10.18.17.231])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 01B6E17AEA;\n\tTue, 12 Sep 2017 18:05:40 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DD4572F14A7","To":"Paolo Bonzini <pbonzini@redhat.com>,\n\t\"Daniel P. Berrange\" <berrange@redhat.com>","References":"<20170912104626.8386-1-berrange@redhat.com>\n\t<810971dc-0a17-cf41-c11a-db991a17317a@redhat.com>\n\t<20170912161252.GM17633@redhat.com>\n\t<5994d2c2-77b3-6698-c9e0-c737c84caf68@redhat.com>\n\t<20170912162223.GN17633@redhat.com>\n\t<76f6207d-165d-d1dd-652f-67038e9f2509@redhat.com>","From":"John Snow <jsnow@redhat.com>","Message-ID":"<55d31a10-5e02-e7a9-5e0a-0d84453e1d79@redhat.com>","Date":"Tue, 12 Sep 2017 14:05:40 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<76f6207d-165d-d1dd-652f-67038e9f2509@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 12 Sep 2017 18:05:42 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] scripts: let checkpatch.pl process an\n\tentire GIT branch","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]