Contrib script to accurately update copyright headers
There is already a script to update or insert copyright headers in the correct format - copyright_headers.py
.
This is a contrib script intended as a helper wrapping around the existing script, intended to allow the script to work on the entire source directory with accurate dates.
Changes
contrib/devtools/copyright_headers_update_or_insert.sh
Contrib script The script works in the following way:
- It runs
copyright_headers.py
on the source tree in update mode - It processes the output to find files that do not have an existing line to update
- It filters those files to remove the third party libraries and auto-generated files
- It runs
copyright_headers.py
again on the identified files in insert mode - It reports insertions, or no-changes, in the same format as
copyright_headers.py
.
Usage: contrib/devtools/copyright_headers_update_or_insert.sh
contrib/devtools/copyright_header.py
Changes to The existing script has been modified to only find changes since the fork commit, 964a185cc83af34587194a6ecda3ed9cf6b49263
, so it will not erroneously add new copyright lines for "the bitcoin developers" in duplicate, for changes made in Core before the fork and already marked "the bitcoin core developers".
Output has also had an over-exuberant exclamation mark removed.
Example results:
...
Future work
A separate MR has been raised to actually update the copyright notices: !1550 (merged)
Test plan
contrib/devtools/copyright_headers_update_or_insert.sh
Examine the git diffs to verify the changes look acceptable. Spot check several files with git log
to confirm the newly updated and inserted copyright periods are correct.