I see in many files 2018 copyright or similar. that seems unlikely.
Can we have a look and update this after 2.2-rc.1?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
@KrisThielemans to create list of files modified in the year using git
.
Also updated header to reflect SyneRBI
Here's some lines that can help with doing this, thanks to StackExchange. Below assumes you have sh
or bash
(so presumably you are on Linux/MacOS)
First step was to update .mailmap
, as people tend to be somewhat careless with the git config
. (All, whatever you put in there will be recorded for the remaining time of the universe! you might want to check.)
git log --format='%aN' | sort -u
Output is now
Alexander C. Whitehead
Ander Biguri
Ashley Gillman
Ben Thomas
Casper da Costa-Luis
Christoph Kolbitsch
Daniel Deidda
David Atkinson
Edoardo Pasca
Evgueni Ovtchinnikov
Johannes Mayer
Kris Thielemans
Matthias Ehrhardt
Richard Brown
Ubuntu
Unknown
The last 2 are examples of people being very careless (you can figure out who they are by doing `git log --author=Ubuntu")
For 1 file, you can see what the date of the last commit by an author was
git log -1 --author=Kris --format="%as" -- CMakeLists.txt
Next step is to add some info on what we have as copyright in the file. We can do a grep -i
(case-insensitive).
We then put this together to get a list of dates for all files using find
. To do this, I use a simple script
#!/bin/sh author=$1 institution=$2 filename=$3 date=`git log -1 --format="%as" --author=$author -- $filename |cut -b1-4` copyright=`grep -i "copyright .*$institution" $filename` if [ ! -z "$date" ]; then echo "$filename: Last commit $date $copyright" fi
and then run for instance
find . -type f -exec ../file_date.sh Evg 'Science\|STFC' {} \; > ../evgueni.log
where the "institution" is a bit complicated as the files sometimes contain STFC and sometimes it's spelled out, so we need to use a pattern Science|STFC
, but that needs to be quoted/escaped to be used correctly inside the script.
Output for that particular run is
evgueni.log
It's a bit messy, but ok for manual processing.
Warning: this relies on your local git
copy being up-to-date, and only looks at the branch currently checkout-out. I'm sure @casperdcl could do better, and his git fame could possibly do this as well, but this was a morning of fun 😁.
I don't think there's any need in going overboard with add copyright to all files, but it should be there and up-to-date for most of the source files.
Can we all remember to update the copyright line when we edit a file in the future please?
hah, sure - feel free to add an example below https://github.com/casperdcl/git-fame#codeowners but
git log/fame/...
Following these steps is more than adequate to cya under any copyright legislation. I urge anyone who thinks otherwise to let me know.
a maximum of 5 lines (upto 80 chars each) of metadata at the top of each file is acceptable.
I have no idea really. I suggest to follow https://www.apache.org/licenses/LICENSE-2.0.html#apply