copyright check pre-commit hook

Erik de Castro Lopo mle+tools at mega-nerd.com
Thu Jan 7 22:59:02 GMT 2010


Hi all,

I asked on #bzr but this is probably a better place :-).

I'd like to have a bzr pre-commit hook that checks copyright notices
in the files being commited for the current year and fail the commit
if the current year is not included.

Eg if 'bzr whoami' says "Erik <erik at hotmail.com>" a commit of a file
containing:

   Copyright (c) 2007-2009  Erik <erik at hotmail.com>
   Copyright (c) 2010  Peter <peter at hotmail.com>

should fail while

   Copyright (c) 2007-2010  Erik <erik at hotmail.com>
   Copyright (c) 2010  Peter <peter at hotmail.com>

should pass.
  
I know nothing of Bzr internals and rarely hack python so doing this
myself is not really a possibility. If someone can hack up something
that works, I can maintain it.

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the bazaar mailing list