hi!

manually maintaining the Changes-licensed-under tags for every commit is 
boring, so i created the following script which you can paste 
into .git/hooks/commit-msg (don't forget to make it executable too) to 
automatically add a Changes-licensed-under tag with the same license as the 
touched files:

git-diff-index --name-only HEAD |
perl -e '
print "\n\n";
while (<>) {
        s/\n//;
        print "$_:\tChanges-licensed-under: ";
        if (/base\.[ch]/) {
                print "3-Clause-BSD\n";
        }
        if (/(ath5k\.h|hw\.[ch]|initvals\.c|phy\.c|regdmon\.[ch]|reg\.h)/) {
                print "ISC\n";
        }
        if (/debug\.[ch]/) {
                print "GPL\n";
        }
        
}
' >> "$1"

i also added the following below, to add a Signed-off-by line:

SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
grep -qs "^$SOB" "$1" || echo -e "\n$SOB" >> "$1"

hope you find that helpful too,
cheers,
bruno
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to