Page tree
Skip to end of metadata
Go to start of metadata

There is a gem called license_header that has a tool for removing and adding license headers. It takes a text file like header.txt and adds it as a comment, changing the comment style for the different filetypes.

I used it like this 

license_header -a -f header.txt ./app #see how many files need to be updated
license_header -u -f header.txt ./app #update headers in the app directory
grep 2017 -r ./app  #find old headers you might have missed

Things to look out for

Don't add headers to the files in the config directory.

The update overwrote one line of code that was a little too close to the header. Out of 328 updates, that's not bad, just something to look for. 

I recommend committing in chunks. Github can only display so many changes before it cuts off the commit. Push up smaller commits, check your changes in the nice handy interface, then rebase and force push back to the branch you're using.

Avoid putting headers on things we didn't actually make, like javascript libraries, db/migrates, etc...


Here's 2015's update:

  • No labels