* [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?
@ 2014-03-18 1:38 Jacopo Notarstefano
2014-03-18 4:40 ` Eric Sunshine
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jacopo Notarstefano @ 2014-03-18 1:38 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano, Michael Haggerty
It seems to me that the topic of adding the checkpatch.pl script to
Git's source tree has cropped up several times in the past, as
recently as a couple of days ago: $gmane/243607.
It should be noted that its usage for its sake has been discouraged by
Junio Hamano in $gmane/205998. Also, its use is somewhat controversial
and has led to flames and even a public fork.
Despite this, I think that git might benefit from a port of
checkpatch.pl. In fact, even Junio had admitted to use part of its
features later in $gmane/205998.
We could simply use linux's script/checkpatch.pl, but I think a port
is needed for these reasons:
1. Git style guidelines are somewhat different and less strict than
their Linux equivalents.
2. Several patch threads bounce back and forth because of style fixes.
A checkpatch script added as a hook could help reduce these and use
more efficiently our time.
3. As far as I can tell, checkpatch needs to be run from the root
folder of a linux repository clone. Cloning several hundred MBs for a
single perl script looks a little foolish to me.
So, is there any interest in adding a port of checkpatch.pl to
contrib/? I might work on this as part of GSoC. I still haven't
submitted my application about git bisect (life got in the way!), but
Michael Heggarty remarked in $gmane/242703 that my original idea had
too little meat in it to constitute a good GSoC proposal.
Cheers,
Jacopo Notarstefano
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?
2014-03-18 1:38 [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/? Jacopo Notarstefano
@ 2014-03-18 4:40 ` Eric Sunshine
2014-03-18 19:39 ` Junio C Hamano
2014-03-18 19:29 ` Junio C Hamano
2014-03-19 8:40 ` demerphq
2 siblings, 1 reply; 6+ messages in thread
From: Eric Sunshine @ 2014-03-18 4:40 UTC (permalink / raw)
To: Jacopo Notarstefano; +Cc: Git Mailing List, Junio C Hamano, Michael Haggerty
On Mon, Mar 17, 2014 at 9:38 PM, Jacopo Notarstefano
<jacopo.notarstefano@gmail.com> wrote:
> It seems to me that the topic of adding the checkpatch.pl script to
> Git's source tree has cropped up several times in the past, as
> recently as a couple of days ago: $gmane/243607.
>
> It should be noted that its usage for its sake has been discouraged by
> Junio Hamano in $gmane/205998.
In the referenced message, Junio says that he often runs checkpatch.pl
on incoming patches.
> Also, its use is somewhat controversial
> and has led to flames and even a public fork.
>
> Despite this, I think that git might benefit from a port of
> checkpatch.pl. In fact, even Junio had admitted to use part of its
> features later in $gmane/205998.
>
> We could simply use linux's script/checkpatch.pl, but I think a port
> is needed for these reasons:
>
> 1. Git style guidelines are somewhat different and less strict than
> their Linux equivalents.
Are checkpatch.pl's customization options, such as --ignore,
insufficient to make it behave in the desired fashion for git?
> 2. Several patch threads bounce back and forth because of style fixes.
> A checkpatch script added as a hook could help reduce these and use
> more efficiently our time.
> 3. As far as I can tell, checkpatch needs to be run from the root
> folder of a linux repository clone. Cloning several hundred MBs for a
> single perl script looks a little foolish to me.
No need to clone the kernel. checkpatch.pl runs fine standalone with
the --no-tree option.
> So, is there any interest in adding a port of checkpatch.pl to
> contrib/? I might work on this as part of GSoC. I still haven't
> submitted my application about git bisect (life got in the way!), but
> Michael Heggarty remarked in $gmane/242703 that my original idea had
> too little meat in it to constitute a good GSoC proposal.
>
> Cheers,
> Jacopo Notarstefano
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?
2014-03-18 4:40 ` Eric Sunshine
@ 2014-03-18 19:39 ` Junio C Hamano
0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2014-03-18 19:39 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Jacopo Notarstefano, Git Mailing List, Michael Haggerty
Eric Sunshine <sunshine@sunshineco.com> writes:
>> 1. Git style guidelines are somewhat different and less strict than
>> their Linux equivalents.
>
> Are checkpatch.pl's customization options, such as --ignore,
> insufficient to make it behave in the desired fashion for git?
If we are to officially encourage the use of checkpatch.pl, we
should stress that mechanically adhering to its check is *not* the
goal. As long as people view it as a tool to _help_ them spot
obvious problems before sending their patches out, but the final
responsibility to produce readable code is upon themselves, not the
script, I am personally fine. Oftentimes we find an occasional long
line that is slightly longer than 80-column limit a lot easier to
read than chopping it artificially in the middle, for example.
>> 2. Several patch threads bounce back and forth because of style fixes.
>> A checkpatch script added as a hook could help reduce these and use
>> more efficiently our time.
>> 3. As far as I can tell, checkpatch needs to be run from the root
>> folder of a linux repository clone. Cloning several hundred MBs for a
>> single perl script looks a little foolish to me.
>
> No need to clone the kernel. checkpatch.pl runs fine standalone with
> the --no-tree option.
>
>> So, is there any interest in adding a port of checkpatch.pl to
>> contrib/?
Not really. Maintaining the forked version is an additional pain we
do not necessarily need. Are we going to carry a port of gcc and
others?
I would rather prefer to add a paragraph in CodingGuidelines that
points at the canonical location to obtain the script, e.g.
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl
and a procedure to run the script over their patch. I am too lazy
to check myself, but there must be somewhere we mention the use of
format-patch and send-email in the document, and use of the script
to check would fall naturally between these two steps, I would
think.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?
2014-03-18 1:38 [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/? Jacopo Notarstefano
2014-03-18 4:40 ` Eric Sunshine
@ 2014-03-18 19:29 ` Junio C Hamano
2014-03-18 23:53 ` Jacopo Notarstefano
2014-03-19 8:40 ` demerphq
2 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2014-03-18 19:29 UTC (permalink / raw)
To: Jacopo Notarstefano; +Cc: Git Mailing List, Michael Haggerty
Jacopo Notarstefano <jacopo.notarstefano@gmail.com> writes:
> It seems to me that the topic of adding the checkpatch.pl script to
> Git's source tree has cropped up several times in the past, as
> recently as a couple of days ago: $gmane/243607.
>
> It should be noted that its usage for its sake has been discouraged by
> Junio Hamano in $gmane/205998.
I've never said any such thing.
I only said I am not enthused against a proposal to add a build
target that runs checkpatch or equivalent over *all* existing code,
which will invite needless churn (read again the part of the message
you quoted before I say "I am not enthused").
It is a totally separate issue for submitters to make sure they do
not introduce *new* problems, and use of "checkpatch --no-tree"
could be one way to do so.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?
2014-03-18 19:29 ` Junio C Hamano
@ 2014-03-18 23:53 ` Jacopo Notarstefano
0 siblings, 0 replies; 6+ messages in thread
From: Jacopo Notarstefano @ 2014-03-18 23:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
On Tue, Mar 18, 2014 at 8:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> I've never said any such thing.
>
> I only said I am not enthused against a proposal to add a build
> target that runs checkpatch or equivalent over *all* existing code,
> which will invite needless churn (read again the part of the message
> you quoted before I say "I am not enthused").
>
> It is a totally separate issue for submitters to make sure they do
> not introduce *new* problems, and use of "checkpatch --no-tree"
> could be one way to do so.
>
Sorry for misrepresenting your opinion. My summarization algorithm
sometimes is _very_ lossy :)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?
2014-03-18 1:38 [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/? Jacopo Notarstefano
2014-03-18 4:40 ` Eric Sunshine
2014-03-18 19:29 ` Junio C Hamano
@ 2014-03-19 8:40 ` demerphq
2 siblings, 0 replies; 6+ messages in thread
From: demerphq @ 2014-03-19 8:40 UTC (permalink / raw)
To: Jacopo Notarstefano; +Cc: Git Mailing List, Junio C Hamano, Michael Haggerty
On 18 March 2014 02:38, Jacopo Notarstefano
<jacopo.notarstefano@gmail.com> wrote:
> 3. As far as I can tell, checkpatch needs to be run from the root
> folder of a linux repository clone. Cloning several hundred MBs for a
> single perl script looks a little foolish to me.
If that is your worry maybe you should upload the script to CPAN.
Yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-19 8:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 1:38 [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/? Jacopo Notarstefano
2014-03-18 4:40 ` Eric Sunshine
2014-03-18 19:39 ` Junio C Hamano
2014-03-18 19:29 ` Junio C Hamano
2014-03-18 23:53 ` Jacopo Notarstefano
2014-03-19 8:40 ` demerphq
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).