How to generate REUSE/SPDX info for a git repo

40 Views Asked by At

Intro

The REUSE tool from the REUSE project by the Free Software Foundation Europe allows to add, maintain and extract detailed copyright and licensing info on a fine-grained scale, and it does that using a format that is both human- and machine-readable. To me, it is excellent work they did there.

In the end though, it is statically tracked info, mostly stored in source file header comments, and as such, it has to be maintained, and - most importantly for existing projects - created. That can be an arduous, boring task to be done by hand, especially when one thinks that a lot of this info could be extracted from the git commit meta-data of the project.

Question

How to reduce the manual workload in initially annotating an already existing project with REUSE info?

1

There are 1 best solutions below

0
hoijui On

I wrote the reuseify.sh BASH script for that purpose. Next to extracting and assigning the git author info, it also simplifies assigning licenses to groups of files using regexes.

Example usage:

cd my-git-project
reuseify.sh --init
# Manually edit file '.reuseify/license_rgxs.tsv'.
reuseify.sh
# Amend the created git commit with your favorite IDE or git GUI.