[SyneRBI/SIRF] copyright dates need updating (#660)

0 views
Skip to first unread message

Kris Thielemans

unread,
May 19, 2020, 1:36:11 PM5/19/20
to SyneRBI/SIRF, Subscribed

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.

Kris Thielemans

unread,
May 28, 2020, 5:56:47 AM5/28/20
to SyneRBI/SIRF, Subscribed

@KrisThielemans to create list of files modified in the year using git.

Also updated header to reflect SyneRBI

Kris Thielemans

unread,
Jun 5, 2020, 5:19:36 AM6/5/20
to SyneRBI/SIRF, Subscribed

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.)

  1. get list of authors (better than committer)
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 😁.

Kris Thielemans

unread,
Jun 5, 2020, 5:20:44 AM6/5/20
to SyneRBI/SIRF, Subscribed

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?

Casper da Costa-Luis

unread,
Jun 5, 2020, 5:36:36 AM6/5/20
to SyneRBI/SIRF, Subscribed

hah, sure - feel free to add an example below https://github.com/casperdcl/git-fame#codeowners but

  • no sane person wants to read a massive copyright notice at the top of every single source file in the whole codebase
  • a maximum of 5 lines (upto 80 chars each) of metadata at the top of each file is acceptable. this could refer to other places which contain more complete information such as:
    • the BOTTOM of the file
    • URLs
    • another author/licence file
    • 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.

Kris Thielemans

unread,
Jun 5, 2020, 5:44:10 AM6/5/20
to SyneRBI/SIRF, Subscribed

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

Kris Thielemans

unread,
Jun 6, 2020, 5:57:55 AM6/6/20
to SyneRBI/SIRF, Subscribed

Closed #660 via #707.

Reply all
Reply to author
Forward
0 new messages