{"thread":{"id":"36203","subject":"[GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","startedAt":"2014-03-18T01:38:04Z","lastAt":"2014-03-19T08:40:24Z","messageCount":6,"participants":["Jacopo Notarstefano","Eric Sunshine","Junio C Hamano","demerphq"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"236947","messageId":"CAL0uuq0RWpWPa2TOk09xE9SjG0-Z=EAMG2iQ9Y0z_XMYvRsJ3g@mail.gmail.com","threadId":"36203","inReplyTo":null,"subject":"[GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","fromName":"Jacopo Notarstefano","fromEmail":"jacopo.notarstefano@gmail.com","sentAt":"2014-03-18T01:38:04Z","receivedAt":"2014-03-18T01:38:04Z","isPatch":false,"sender":{"key":"jacopo.notarstefano@gmail.com","avatar":"https://avatars.githubusercontent.com/u/381280?v=4"},"body":"It seems to me that the topic of adding the checkpatch.pl script to\nGit's source tree has cropped up several times in the past, as\nrecently as a couple of days ago: $gmane/243607.\n\nIt should be noted that its usage for its sake has been discouraged by\nJunio Hamano in $gmane/205998. Also, its use is somewhat controversial\nand has led to flames and even a public fork.\n\nDespite this, I think that git might benefit from a port of\ncheckpatch.pl. In fact, even Junio had admitted to use part of its\nfeatures later in $gmane/205998.\n\nWe could simply use linux's script/checkpatch.pl, but I think a port\nis needed for these reasons:\n\n1. Git style guidelines are somewhat different and less strict than\ntheir Linux equivalents.\n2. Several patch threads bounce back and forth because of style fixes.\nA checkpatch script added as a hook could help reduce these and use\nmore efficiently our time.\n3. As far as I can tell, checkpatch needs to be run from the root\nfolder of a linux repository clone. Cloning several hundred MBs for a\nsingle perl script looks a little foolish to me.\n\nSo, is there any interest in adding a port of checkpatch.pl to\ncontrib/? I might work on this as part of GSoC. I still haven't\nsubmitted my application about git bisect (life got in the way!), but\nMichael Heggarty remarked in $gmane/242703 that my original idea had\ntoo little meat in it to constitute a good GSoC proposal.\n\nCheers,\nJacopo Notarstefano\n"},{"id":"236956","messageId":"CAPig+cQPZrHf_Bm_s_qmP6nX2dKcFNi+EUKoPObXHn1novuaHw@mail.gmail.com","threadId":"36203","inReplyTo":"CAL0uuq0RWpWPa2TOk09xE9SjG0-Z=EAMG2iQ9Y0z_XMYvRsJ3g@mail.gmail.com","subject":"Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2014-03-18T04:40:13Z","receivedAt":"2014-03-18T04:40:13Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Mar 17, 2014 at 9:38 PM, Jacopo Notarstefano\n<jacopo.notarstefano@gmail.com> wrote:\n> It seems to me that the topic of adding the checkpatch.pl script to\n> Git's source tree has cropped up several times in the past, as\n> recently as a couple of days ago: $gmane/243607.\n>\n> It should be noted that its usage for its sake has been discouraged by\n> Junio Hamano in $gmane/205998.\n\nIn the referenced message, Junio says that he often runs checkpatch.pl\non incoming patches.\n\n> Also, its use is somewhat controversial\n> and has led to flames and even a public fork.\n>\n> Despite this, I think that git might benefit from a port of\n> checkpatch.pl. In fact, even Junio had admitted to use part of its\n> features later in $gmane/205998.\n>\n> We could simply use linux's script/checkpatch.pl, but I think a port\n> is needed for these reasons:\n>\n> 1. Git style guidelines are somewhat different and less strict than\n> their Linux equivalents.\n\nAre checkpatch.pl's customization options, such as --ignore,\ninsufficient to make it behave in the desired fashion for git?\n\n> 2. Several patch threads bounce back and forth because of style fixes.\n> A checkpatch script added as a hook could help reduce these and use\n> more efficiently our time.\n> 3. As far as I can tell, checkpatch needs to be run from the root\n> folder of a linux repository clone. Cloning several hundred MBs for a\n> single perl script looks a little foolish to me.\n\nNo need to clone the kernel. checkpatch.pl runs fine standalone with\nthe --no-tree option.\n\n> So, is there any interest in adding a port of checkpatch.pl to\n> contrib/? I might work on this as part of GSoC. I still haven't\n> submitted my application about git bisect (life got in the way!), but\n> Michael Heggarty remarked in $gmane/242703 that my original idea had\n> too little meat in it to constitute a good GSoC proposal.\n>\n> Cheers,\n> Jacopo Notarstefano\n"},{"id":"237001","messageId":"xmqqeh1z8fv8.fsf@gitster.dls.corp.google.com","threadId":"36203","inReplyTo":"CAL0uuq0RWpWPa2TOk09xE9SjG0-Z=EAMG2iQ9Y0z_XMYvRsJ3g@mail.gmail.com","subject":"Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-18T19:29:47Z","receivedAt":"2014-03-18T19:29:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacopo Notarstefano <jacopo.notarstefano@gmail.com> writes:\n\n> It seems to me that the topic of adding the checkpatch.pl script to\n> Git's source tree has cropped up several times in the past, as\n> recently as a couple of days ago: $gmane/243607.\n>\n> It should be noted that its usage for its sake has been discouraged by\n> Junio Hamano in $gmane/205998.\n\nI've never said any such thing.\n\nI only said I am not enthused against a proposal to add a build\ntarget that runs checkpatch or equivalent over *all* existing code,\nwhich will invite needless churn (read again the part of the message\nyou quoted before I say \"I am not enthused\").\n\nIt is a totally separate issue for submitters to make sure they do\nnot introduce *new* problems, and use of \"checkpatch --no-tree\"\ncould be one way to do so.\n"},{"id":"237002","messageId":"xmqqa9cn8fep.fsf@gitster.dls.corp.google.com","threadId":"36203","inReplyTo":"CAPig+cQPZrHf_Bm_s_qmP6nX2dKcFNi+EUKoPObXHn1novuaHw@mail.gmail.com","subject":"Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-18T19:39:42Z","receivedAt":"2014-03-18T19:39:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n>> 1. Git style guidelines are somewhat different and less strict than\n>> their Linux equivalents.\n>\n> Are checkpatch.pl's customization options, such as --ignore,\n> insufficient to make it behave in the desired fashion for git?\n\nIf we are to officially encourage the use of checkpatch.pl, we\nshould stress that mechanically adhering to its check is *not* the\ngoal.  As long as people view it as a tool to _help_ them spot\nobvious problems before sending their patches out, but the final\nresponsibility to produce readable code is upon themselves, not the\nscript, I am personally fine.  Oftentimes we find an occasional long\nline that is slightly longer than 80-column limit a lot easier to\nread than chopping it artificially in the middle, for example.\n\n>> 2. Several patch threads bounce back and forth because of style fixes.\n>> A checkpatch script added as a hook could help reduce these and use\n>> more efficiently our time.\n>> 3. As far as I can tell, checkpatch needs to be run from the root\n>> folder of a linux repository clone. Cloning several hundred MBs for a\n>> single perl script looks a little foolish to me.\n>\n> No need to clone the kernel. checkpatch.pl runs fine standalone with\n> the --no-tree option.\n>\n>> So, is there any interest in adding a port of checkpatch.pl to\n>> contrib/?\n\nNot really.  Maintaining the forked version is an additional pain we\ndo not necessarily need.  Are we going to carry a port of gcc and\nothers?\n\nI would rather prefer to add a paragraph in CodingGuidelines that\npoints at the canonical location to obtain the script, e.g.\n\nhttps://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl\n\nand a procedure to run the script over their patch.  I am too lazy\nto check myself, but there must be somewhere we mention the use of\nformat-patch and send-email in the document, and use of the script\nto check would fall naturally between these two steps, I would\nthink.\n"},{"id":"237027","messageId":"CAL0uuq3Rgp-7tvqOnN1PX_ZhK3M529MGQB3jcMRMPOTY2JdUng@mail.gmail.com","threadId":"36203","inReplyTo":"xmqqeh1z8fv8.fsf@gitster.dls.corp.google.com","subject":"Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","fromName":"Jacopo Notarstefano","fromEmail":"jacopo.notarstefano@gmail.com","sentAt":"2014-03-18T23:53:03Z","receivedAt":"2014-03-18T23:53:03Z","isPatch":false,"sender":{"key":"jacopo.notarstefano@gmail.com","avatar":"https://avatars.githubusercontent.com/u/381280?v=4"},"body":"On Tue, Mar 18, 2014 at 8:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> I've never said any such thing.\n>\n> I only said I am not enthused against a proposal to add a build\n> target that runs checkpatch or equivalent over *all* existing code,\n> which will invite needless churn (read again the part of the message\n> you quoted before I say \"I am not enthused\").\n>\n> It is a totally separate issue for submitters to make sure they do\n> not introduce *new* problems, and use of \"checkpatch --no-tree\"\n> could be one way to do so.\n>\n\nSorry for misrepresenting your opinion. My summarization algorithm\nsometimes is _very_ lossy :)\n"},{"id":"237048","messageId":"CANgJU+UEqJ-x9-T0tXPpgPq1-Sw888CppODrszqOXqLDOmr-Kw@mail.gmail.com","threadId":"36203","inReplyTo":"CAL0uuq0RWpWPa2TOk09xE9SjG0-Z=EAMG2iQ9Y0z_XMYvRsJ3g@mail.gmail.com","subject":"Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2014-03-19T08:40:24Z","receivedAt":"2014-03-19T08:40:24Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On 18 March 2014 02:38, Jacopo Notarstefano\n<jacopo.notarstefano@gmail.com> wrote:\n> 3. As far as I can tell, checkpatch needs to be run from the root\n> folder of a linux repository clone. Cloning several hundred MBs for a\n> single perl script looks a little foolish to me.\n\nIf that is your worry maybe you should upload the script to CPAN.\n\nYves\n\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"}]}