Skip to content

contributing: Define the SPDX copyright header convention#7749

Open
wenzeslaus wants to merge 5 commits into
OSGeo:mainfrom
wenzeslaus:spdx-convention
Open

contributing: Define the SPDX copyright header convention#7749
wenzeslaus wants to merge 5 commits into
OSGeo:mainfrom
wenzeslaus:spdx-convention

Conversation

@wenzeslaus

@wenzeslaus wenzeslaus commented Jul 17, 2026

Copy link
Copy Markdown
Member

Defines the SPDX copyright header convention that #7743 applies to most of the source files.

  • COPYING says what "Other GRASS authors" means.
  • The style guide templates use SPDX tags, finishing what docs: Use SPDX license ID for new files #6001 started when it replaced the GPL prose with SPDX-License-Identifier and left the COPYRIGHT field alone.
  • g.parser --script generates the new header, with the documentation updated to match and a test for the generated header.
  • Removes utils/copywrite.pl, which is unused and cannot run.
  • It changes the license info itself in the parser because that file is excluded from contributing: Use SPDX copyright tags in file headers #7743.

COPYING gains the following which fits with #7743:

Copyright notices in individual source files use SPDX tags, for example:

  SPDX-FileCopyrightText: 1999-2022 Jane Doe
  SPDX-FileCopyrightText: Other GRASS authors
  SPDX-License-Identifier: GPL-2.0-or-later

Other GRASS authors denotes the authors of a file who are not named
individually in it.

The decisions were made during GRASS Community Meeting 2026 in San Michele all'Adige.

Technically this should merge before #7743, which uses the term this defines, but it does not have to.

Written with AI assistance (Claude Code with Opus 4.8 and Fable 5), especially the tests.

Details (mostly AI generated)

The five files that specify a header

These were left out of #7743 because each states what a header should look like rather than merely carrying one, so they need reading rather than converting, and two of them generate headers into new files.

  • COPYING defines the collective by authorship rather than by membership of a body.
  • doc/development/style_guide.md converts all three templates, Python, wxGUI docstring and C, and states the rules the templates cannot show: who adds a line, when, and that other people's lines are left alone. The wxGUI template is team-only, so its collective keeps the year; the other two name a holder, so their collective is bare.
  • lib/gis/parser_script.c replaces ten fprintf calls emitting the GPL paragraph with three SPDX lines. GRASS_VERSION_DATE is a bare year, so it feeds SPDX-FileCopyrightText unchanged. Its own header is converted too.
  • general/g.parser/g.parser.md and .html update the sample output in the same commit as the code, so the documentation never shows a header the tool cannot produce. Nothing tests this, so it holds by review rather than automatically.
  • utils/copywrite.pl is removed. Nothing references it, it shells out to cvs2cl.pl which is not in the repository and which reads CVS history that no longer exists, and it hardcodes launching xemacs.

The test

general/g.parser/tests/g_parser_script_test.py checks the generated script for the SPDX lines and (the lack of) COPYRIGHT field or GPL prose, and that each copyright line names one holder with the collective last.

Source file copyright notices are moving to SPDX tags, where the
collective holder is spelled "Other GRASS authors". Define it, so that the
files carrying it point at something.

The definition is by authorship rather than by membership of a body: the
authors of a file who are not named individually in it. COPYING already
opens by saying GRASS is copyright by members of the GRASS Development
Team, so the new text does not restate it.

The wording avoids quotation marks and apostrophes deliberately. COPYING is
wrapped line by line into C string literals by include/CMakeLists.txt and
include/grass/Makefile, neither of which escapes anything, and the file has
never contained either character.
Commit 0211182 replaced the GPL prose in these templates with an
SPDX-License-Identifier line and left the COPYRIGHT field alone. Finish
that move: replace the field with SPDX-FileCopyrightText lines so the
whole notice is machine readable.

One holder per line, named holders first, the collective line last, and
the license identifier after all copyright lines. COPYING defines the
collective. State the rules next to the template, since the templates
alone do not say who adds a line or when.

Drafted with AI assistance (Claude Opus 4.8); the decisions are the
author's.
Scripts generated by --script carried a COPYRIGHT field and the full GPL
paragraph. Emit SPDX tags instead, matching the style guide templates, so
that generated scripts start out in the form the project documents.

GRASS_VERSION_DATE is a bare year, so it feeds SPDX-FileCopyrightText
unchanged.

Update the sample output in both g.parser.md and g.parser.html in the same
commit, so the documentation never shows a header the tool cannot produce.

Convert this file's own header as well: a generator that emits SPDX tags
while carrying a legacy notice contradicts itself. The remaining files
using the bare (C) notice form are out of scope here.

Drafted with AI assistance (Claude Opus 4.8); the decisions are the
author's.
Check the properties the header has to hold to rather than its exact text:
that no COPYRIGHT field or GPL paragraph survives in the generated script,
and that each copyright line names one holder with the collective line last.

Comparing against a copy of the template would only restate what
parser_script.c already defines, and would need updating whenever that file
changes, so it would report edits rather than find faults.

Written with AI assistance (Claude Opus 4.8); the decisions are the
author's.
The script is unreferenced, and it cannot run: it shells out to cvs2cl.pl,
which is not in the repository and which reads CVS history that no longer
exists, and it hardcodes launching xemacs.

It also embeds a third header template, which would otherwise have to be
kept in sync with the style guide and with g.parser --script. Its method,
deriving copyright holders by parsing commit history, is not one the
project wants to carry forward.

Removing the file does not strip a copyright notice from any surviving
file, and its authorship remains in the history.
@github-actions github-actions Bot added Python Related code is in Python C Related code is in C HTML Related code is in HTML libraries module docs markdown Related to markdown, markdown files general tests Related to Test Suite labels Jul 17, 2026

@cwhite911 cwhite911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good I just had a few clarifying questions that I don't know if they are correct or not.

Comment thread lib/gis/parser_script.c
Comment thread COPYING
Comment thread general/g.parser/g.parser.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C docs general HTML Related code is in HTML libraries markdown Related to markdown, markdown files module Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants