Skip to content

Name the authors of each file from its history - #709

Merged
sofian merged 4 commits into
devfrom
doc-copyright-from-history
Dec 4, 2026
Merged

sofian merged 4 commits into
devfrom
doc-copyright-from-history

Conversation

@sofian

@sofian sofian commented Dec 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Each source file now names, in its header, every person who changed it, with the years of their commits, in the order of their first contribution, without email addresses:
     * (c) 2013-2026 Sofian Audry
     * (c) 2013-2026 Alexandre Quessy
     * (c) 2013 Sylvain Cormier
     * (c) 2013-2014 Vasilis Liaskovitis
     * (c) 2014-2018 Dame Diongue
    
    It replaces "(c) 2026 MapMap contributors", which said nothing of who wrote a file, the obfuscated addresses, and headers that named only the first authors of a file.
  • scripts/update-copyright.py writes these lines from the history of git (git log --follow), and --check lists the files that are not up to date. A commit that only changes spaces, only the lines of the authors, or only renames a file is not a contribution, nor are the mass edits listed in .git-blame-ignore-revs. Authors that the history does not know, such as those of code older than MapMap (Drone, Toonloop), are kept with their notes. Third-party code (src/control/qosc, third_party) and the files without the licence header (src/app/main.cpp, src/control/ConcurrentQueue.h) are left as they are.
  • .mailmap gives each person one name: Tats and Sofian are Sofian Audry, baydam and Bay Dam are Dame Diongue, and ltsAdair, jonathan and sylvain are Lucas Adair, Jonathan Roman Bland and Sylvain Cormier, as in CONTRIBUTORS.md. git log, git shortlog and git blame read it too. Other people keep the name of their commits.
  • .git-blame-ignore-revs lists 9 mass edits: the namespaces of 2016, the moves of files of 2017, and the renaming of Paint to Source and Mapping to Layer of 2026. GitHub's blame view skips them, and so does git blame with git config blame.ignoreRevsFile .git-blame-ignore-revs.
  • AGENTS.md asks for one line per author in a new file, and to run the script before a release.
  • Once this is in dev, the commit that rewrites the headers goes in .git-blame-ignore-revs, in a later commit: its hash changes when it is integrated.

Demo

  1. Open src/gui/MapperGLCanvas.cpp or src/core/VideoImpl.h: the header names each author with their years.
  2. Run python3 scripts/update-copyright.py --check: it lists nothing, and running the script again changes nothing.
  3. Run git shortlog -sn: each person is counted once.

Tests

  • Every commit built and passed the unit tests on Ubuntu (Qt 6, QT_QPA_PLATFORM=offscreen), after a rebase on dev; only comment lines change in the C++ files.
  • python3 -m unittest tests.test_update_copyright: 11 tests, on headers and on a small repository made for the test (names from .mailmap, spaces, lines of authors, mass edits, a second run).
  • tests/test_convert_beta1_project.py already fails on dev: its reference tests/fixtures/beta.2/triangle-color.mmp changed on 2026-11-28. Not changed here.

@sofian sofian added this to the 1.0 milestone Dec 4, 2026
@sofian sofian self-assigned this Dec 4, 2026
@sofian
sofian requested a review from aalex December 4, 2026 18:09
@sofian
sofian merged commit b22c580 into dev Dec 4, 2026
3 checks passed
@sofian
sofian deleted the doc-copyright-from-history branch December 4, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants