You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Rajith Attapattu <ra...@gmail.com> on 2011/02/15 17:21:28 UTC

Pre commit hook for Apache License Header ?

Hi All,

It seems there is good support for adding a pre-commit hook for checking
JIRA reference.
While we are at it, I'd like to draw your attention to another problem that
makes a release managers job unnecessarily tedious.

We all have been guilty of adding files to the svn repo without the
mandatory license header.

I believe there is a good case for adding a pre commit hook that checks the
license header when adding new files.
We also need to have a mechanism to ensure certain files get exempted from
this check.

Thoughts ?

Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

Re: Pre commit hook for Apache License Header ?

Posted by Rajith Attapattu <ra...@gmail.com>.
The automated RAT report is a good alternative IMO.
However I still think a license check is not a bad idea as it will only come
into play when somebody adds a file.

It seems other have atleast tried this.
http://osdir.com/ml/windows.dotnet.castleproject.devel/2005-07/msg00266.html

Rajith

On Tue, Feb 15, 2011 at 4:54 PM, Andrew Kennedy <
andrewinternational@gmail.com> wrote:

> On 15 Feb 2011, at 19:49, Robbie Gemmell wrote:
>
>> There is scope for inaccurate results on licence matching, and
>> exceptions could also be a pain if conducted pre-commit, so I'm not
>> sure it should be a commit hook. We should really just have RAT
>> running automated checks for us on the ASF CI boxes (along with
>> several other types of testing...) on a regular basis.
>>
>
>
> Agree.
>
> There is a Maven plug-in for that. I have set up my Mavenised Qpid build to
> run a RAT report automatically during CI, as part of the "mvn site"
> generation. This works vey nicely, and if^H^Hwhen we move to Maven from Ant,
> we can set it up very easily.
>
> Andrew.
> --
> -- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
> -- http://grkvlt.blogspot.com/ ? edinburgh : +44 7582 293 255 ;
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>


-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

Re: Pre commit hook for Apache License Header ?

Posted by Andrew Kennedy <an...@gmail.com>.
On 15 Feb 2011, at 19:49, Robbie Gemmell wrote:
> There is scope for inaccurate results on licence matching, and
> exceptions could also be a pain if conducted pre-commit, so I'm not
> sure it should be a commit hook. We should really just have RAT
> running automated checks for us on the ASF CI boxes (along with
> several other types of testing...) on a regular basis.


Agree.

There is a Maven plug-in for that. I have set up my Mavenised Qpid  
build to run a RAT report automatically during CI, as part of the  
"mvn site" generation. This works vey nicely, and if^H^Hwhen we move  
to Maven from Ant, we can set it up very easily.

Andrew.
-- 
-- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
-- http://grkvlt.blogspot.com/ ? edinburgh : +44 7582 293 255 ;

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Pre commit hook for Apache License Header ?

Posted by Robbie Gemmell <ro...@gmail.com>.
There is scope for inaccurate results on licence matching, and
exceptions could also be a pain if conducted pre-commit, so I'm not
sure it should be a commit hook. We should really just have RAT
running automated checks for us on the ASF CI boxes (along with
several other types of testing...) on a regular basis.

I licenced a lot of stuff for the last release even if it was deemed
not to require a licence in previous releases, so there is a vastly
reduced scope of results for consideration now. Automating a check
which ruled out known good files and alerted us on eg a weekly basis
to any new suspects seems like it would be sufficient here. Adding
licences to actual new code files wasnt that much of a burden for 0.8
from what I remember.

Robbie

On 15 February 2011 16:21, Rajith Attapattu <ra...@gmail.com> wrote:
> Hi All,
>
> It seems there is good support for adding a pre-commit hook for checking
> JIRA reference.
> While we are at it, I'd like to draw your attention to another problem that
> makes a release managers job unnecessarily tedious.
>
> We all have been guilty of adding files to the svn repo without the
> mandatory license header.
>
> I believe there is a good case for adding a pre commit hook that checks the
> license header when adding new files.
> We also need to have a mechanism to ensure certain files get exempted from
> this check.
>
> Thoughts ?
>
> Regards,
>
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Pre commit hook for Apache License Header ?

Posted by Rajith Attapattu <ra...@gmail.com>.
On Tue, Feb 15, 2011 at 12:43 PM, Emmanuel Bourg <eb...@apache.org> wrote:

> Le 15/02/2011 17:21, Rajith Attapattu a écrit :
>
>  Hi All,
>>
>> It seems there is good support for adding a pre-commit hook for checking
>> JIRA reference.
>> While we are at it, I'd like to draw your attention to another problem
>> that
>> makes a release managers job unnecessarily tedious.
>>
>> We all have been guilty of adding files to the svn repo without the
>> mandatory license header.
>>
>> I believe there is a good case for adding a pre commit hook that checks
>> the
>> license header when adding new files.
>> We also need to have a mechanism to ensure certain files get exempted from
>> this check.
>>
>> Thoughts ?
>>
>
> IMHO this is better handled at release time with tools like RAT. Adding too
> many hurdles to commits will quickly turn the development into a frustrating
> experience.
>

Well I had to patch RAT and run my own custom version to catch all the
issues.
I have acted as release manager twice and as backup/stand-in several times
and I can tell you it's not a particularly pleasant task to fix all the
licensing headers.

Besides this check will only affect when we add a new file - how often do we
add new files ? If we think about it, not that too often.
Most commits are for existing files. So I disagree that this will make
committing changes a frustrating experience.

Rajith.


>
> Emmanuel
>
>


-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

Re: Pre commit hook for Apache License Header ?

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 15/02/2011 17:21, Rajith Attapattu a écrit :
> Hi All,
>
> It seems there is good support for adding a pre-commit hook for checking
> JIRA reference.
> While we are at it, I'd like to draw your attention to another problem that
> makes a release managers job unnecessarily tedious.
>
> We all have been guilty of adding files to the svn repo without the
> mandatory license header.
>
> I believe there is a good case for adding a pre commit hook that checks the
> license header when adding new files.
> We also need to have a mechanism to ensure certain files get exempted from
> this check.
>
> Thoughts ?

IMHO this is better handled at release time with tools like RAT. Adding 
too many hurdles to commits will quickly turn the development into a 
frustrating experience.

Emmanuel