Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Dec 7, 2019

This PR improves contrib/devtools/copyright_header.py script and adds copyright headers to the files in src and test directories with two exceptions:

On master 5622d8f:

$ ./contrib/devtools/copyright_header.py report . | grep zero
  25 with zero copyrights

With this PR:

$ ./contrib/devtools/copyright_header.py report . | grep zero
   2 with zero copyrights

I am uncertain about our copyright policy with build_msvc and contrib directories content, so they are out of scope of this PR.

@practicalswift
Copy link
Contributor

practicalswift commented Dec 7, 2019

Concept ACK

While we are at it: if we are to keep the external license links (to opensource.org) perhaps it is time to do the switch from http to https?

Alternatively we could just switch from …

// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

… to …

// Distributed under the MIT software license, see the accompanying
// file COPYING.

I think I prefer the latter: using a link potentially introduces ambiguity and we shouldn't rely on external third party sites unless necessary :)

@fanquake
Copy link
Member

Concept ACK on adding the missing headers.

In the future I'd prefer if these scripts were moved out of bitcoin/bitcoin; maybe into the maintainer tools repository. To me it seems a bit ridiculous that we've got 600 lines of bash in this repository to do copyright header "management".

@@ -491,17 +491,28 @@ def file_has_hashbang(file_lines):
return False
return file_lines[0][:2] == '#!'

def insert_shell_header(filename, file_lines, start_year, end_year):
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? Couldn't the function where you copied this from be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@maflcko
Copy link
Member

maflcko commented Jan 2, 2020

To me it seems a bit ridiculous that we've got 600 lines of bash

I think it is python, but still ridiculous. Though having it in the repo, at least allows to do it in a scripted-diff. For the future, I am hoping we can get rid of the years after (c).

@hebasto hebasto force-pushed the 20191207-copyright-headers branch from a5511dc to 6257ff9 Compare January 3, 2020 15:33
@hebasto
Copy link
Member Author

hebasto commented Jan 3, 2020

@practicalswift
I'm not sure that the license header content changing should be addressed by this PR.

@MarcoFalke
Your comment has been addressed.

@sipsorcery
What do you think about copyright headers in these files:

  • build_msvc/bitcoin_config.h
  • build_msvc/msvc-autogen.py
  • build_msvc/testconsensus/testconsensus.cpp
    ?

@dongcarl
What do you think about copyright headers in these files:

  • contrib/guix/guix-build.sh
  • contrib/guix/libexec/build.sh
    ?

@hebasto hebasto force-pushed the 20191207-copyright-headers branch from 6257ff9 to 0c4f7be Compare January 3, 2020 15:48
@sipsorcery
Copy link
Contributor

@hebasto sounds like a good idea to me. There was no particular reason copyright headers were left out of the files.

-BEGIN VERIFY SCRIPT-
s() { contrib/devtools/copyright_header.py insert "$1"; }

s build_msvc/bitcoin_config.h
s build_msvc/msvc-autogen.py
s build_msvc/testconsensus/testconsensus.cpp
s contrib/devtools/circular-dependencies.py
s contrib/devtools/gen-manpages.sh
s contrib/filter-lcov.py
s contrib/gitian-build.py
s contrib/install_db4.sh
s src/crypto/sha256_avx2.cpp
s src/crypto/sha256_sse41.cpp
s src/fs.cpp
s src/qt/test/addressbooktests.cpp
s src/qt/test/addressbooktests.h
s src/qt/test/util.cpp
s src/qt/test/util.h
s src/qt/test/wallettests.cpp
s src/qt/test/wallettests.h
s src/test/blockchain_tests.cpp
s test/functional/combine_logs.py
s test/lint/lint-locale-dependence.sh
sed -i '1G' test/lint/lint-shebang.sh
s test/lint/lint-shebang.sh
-END VERIFY SCRIPT-
@hebasto hebasto force-pushed the 20191207-copyright-headers branch from 0c4f7be to fac86ac Compare January 4, 2020 18:21
@hebasto
Copy link
Member Author

hebasto commented Jan 4, 2020

@sipsorcery

@hebasto sounds like a good idea to me. There was no particular reason copyright headers were left out of the files.

Thanks, missed headers are added in build_msvc/ subdirectory in the latest push.

@maflcko
Copy link
Member

maflcko commented Jan 6, 2020

ACK fac86ac

maflcko pushed a commit that referenced this pull request Jan 16, 2020
fac86ac scripted-diff: Add missed copyright headers (Hennadii Stepanov)
6fde9d5 script: Update EXLUDE list in copyright_header.py (Hennadii Stepanov)
1998152 script: Add empty line after C++ copyright (Hennadii Stepanov)
071f2fc script: Add ability to insert copyright to *.sh (Hennadii Stepanov)

Pull request description:

  This PR improves `contrib/devtools/copyright_header.py` script and adds copyright headers to the files in `src` and `test` directories with two exceptions:
  - [`src/reverse_iterator.h`](https://github.com/bitcoin/bitcoin/blob/master/src/reverse_iterator.h) (added to exceptions)
  - [`src/test/fuzz/FuzzedDataProvider.h`](https://github.com/bitcoin/bitcoin/blob/master/src/test/fuzz/FuzzedDataProvider.h) (added to exceptions)

  On master 5622d8f:
  ```
  $ ./contrib/devtools/copyright_header.py report . | grep zero
    25 with zero copyrights
  ```

  With this PR:
  ```
  $ ./contrib/devtools/copyright_header.py report . | grep zero
     2 with zero copyrights
  ```

  ~I am uncertain about our copyright policy with `build_msvc` and `contrib` directories content, so they are out of scope of this PR.~

ACKs for top commit:
  MarcoFalke:
    ACK fac86ac

Tree-SHA512: d7832c4a7a1a3b7806119775b40ec35d7982f49ff0e6199b8cee4c0e0a36e68d51728b6ee9924b1c161df4bc6105bd93391b79d42914357fa522f499cb113fa8
@maflcko maflcko merged commit fac86ac into bitcoin:master Jan 16, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 17, 2020
fac86ac scripted-diff: Add missed copyright headers (Hennadii Stepanov)
6fde9d5 script: Update EXLUDE list in copyright_header.py (Hennadii Stepanov)
1998152 script: Add empty line after C++ copyright (Hennadii Stepanov)
071f2fc script: Add ability to insert copyright to *.sh (Hennadii Stepanov)

Pull request description:

  This PR improves `contrib/devtools/copyright_header.py` script and adds copyright headers to the files in `src` and `test` directories with two exceptions:
  - [`src/reverse_iterator.h`](https://github.com/bitcoin/bitcoin/blob/master/src/reverse_iterator.h) (added to exceptions)
  - [`src/test/fuzz/FuzzedDataProvider.h`](https://github.com/bitcoin/bitcoin/blob/master/src/test/fuzz/FuzzedDataProvider.h) (added to exceptions)

  On master 5622d8f:
  ```
  $ ./contrib/devtools/copyright_header.py report . | grep zero
    25 with zero copyrights
  ```

  With this PR:
  ```
  $ ./contrib/devtools/copyright_header.py report . | grep zero
     2 with zero copyrights
  ```

  ~I am uncertain about our copyright policy with `build_msvc` and `contrib` directories content, so they are out of scope of this PR.~

ACKs for top commit:
  MarcoFalke:
    ACK fac86ac

Tree-SHA512: d7832c4a7a1a3b7806119775b40ec35d7982f49ff0e6199b8cee4c0e0a36e68d51728b6ee9924b1c161df4bc6105bd93391b79d42914357fa522f499cb113fa8
@hebasto hebasto deleted the 20191207-copyright-headers branch January 18, 2020 09:18
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Apr 7, 2020
- doc: fix git add argument bitcoin#18513
- build: Fix libevent linking for bench_bitcoin binary bitcoin#18397
- script: fix SCRIPT_ERR_SIG_PUSHONLY error string bitcoin#18412
- doc: Comment fix merkle.cpp bitcoin#18379
- log: Fix UB with bench on genesis block bitcoin#15283
- test: Fix mining to an invalid target + ensure that a new block has the correct hash internally bitcoin#18350
- Fix missing header in sync.h bitcoin#18357
- refactor: Fix implicit value conversion in formatPingTime bitcoin#18260
- Fix .gitignore policy in build_msvc directory bitcoin#18108
- build: Fix behavior when ALLOW_HOST_PACKAGES unset bitcoin#18051
- test: Fix p2p_invalid_messages failing in Python 3.8 because of warning bitcoin#17931
- qa: Fix double-negative arg test bitcoin#17893
- build: Fix configure report about qr bitcoin#17547
- log: Fix log message for -par=1 bitcoin#17325
- bench: Fix negative values and zero for -evals flag bitcoin#17267
- depends: fix boost mac cross build with clang 9+ bitcoin#17231
- doc: Fix broken bitcoin-cli examples bitcoin#17119
- doc: fix Makefile target in benchmarking.md bitcoin#17081
- contrib: fix minor typos in makeseeds.py bitcoin#17042
- test: Fix Python Docstring to include all Args. bitcoin#17030
- doc: Fix some misspellings bitcoin#17351
- doc: Doxygen-friendly script/descriptor.h comments bitcoin#16947
- doc: Fix doxygen errors bitcoin#17945
- doc: Doxygen-friendly CuckooCache comments bitcoin#16986
- doc: Add to Doxygen documentation guidelines bitcoin#17873
- depends: Consistent use of package variable bitcoin#17928
- init: Replace URL_WEBSITE with PACKAGE_URL bitcoin#18503
- doc: Add missed copyright headers bitcoin#17691
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
fac86ac scripted-diff: Add missed copyright headers (Hennadii Stepanov)
6fde9d5 script: Update EXLUDE list in copyright_header.py (Hennadii Stepanov)
1998152 script: Add empty line after C++ copyright (Hennadii Stepanov)
071f2fc script: Add ability to insert copyright to *.sh (Hennadii Stepanov)

Pull request description:

  This PR improves `contrib/devtools/copyright_header.py` script and adds copyright headers to the files in `src` and `test` directories with two exceptions:
  - [`src/reverse_iterator.h`](https://github.com/bitcoin/bitcoin/blob/master/src/reverse_iterator.h) (added to exceptions)
  - [`src/test/fuzz/FuzzedDataProvider.h`](https://github.com/bitcoin/bitcoin/blob/master/src/test/fuzz/FuzzedDataProvider.h) (added to exceptions)

  On master 5622d8f:
  ```
  $ ./contrib/devtools/copyright_header.py report . | grep zero
    25 with zero copyrights
  ```

  With this PR:
  ```
  $ ./contrib/devtools/copyright_header.py report . | grep zero
     2 with zero copyrights
  ```

  ~I am uncertain about our copyright policy with `build_msvc` and `contrib` directories content, so they are out of scope of this PR.~

ACKs for top commit:
  MarcoFalke:
    ACK fac86ac

Tree-SHA512: d7832c4a7a1a3b7806119775b40ec35d7982f49ff0e6199b8cee4c0e0a36e68d51728b6ee9924b1c161df4bc6105bd93391b79d42914357fa522f499cb113fa8
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 20, 2021
Summary:
script: Add ability to insert copyright to *.sh
script: Add empty line after C++ copyright
script: Update EXLUDE list in copyright_header.py

This is a backport of [[bitcoin/bitcoin#17691 | core#17691]] [1/2]
bitcoin/bitcoin@071f2fc
bitcoin/bitcoin@1998152
bitcoin/bitcoin@6fde9d5

Depends on D9813

Test Plan: `./contrib/devtools/copyright_header.py report .`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9814
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 20, 2021
Summary:
Scripted diff:
```
s() { contrib/devtools/copyright_header.py insert "$1"; }

s contrib/devtools/circular-dependencies.py
s doc/man/gen-manpages.sh
s cmake/utils/filter-lcov.py
s contrib/gitian-build.py
s src/crypto/sha256_avx2.cpp
s src/crypto/sha256_sse41.cpp
s src/qt/test/addressbooktests.cpp
s src/qt/test/addressbooktests.h
s src/qt/test/util.cpp
s src/qt/test/util.h
s src/qt/test/wallettests.cpp
s src/qt/test/wallettests.h
s src/test/blockchain_tests.cpp
s test/functional/combine_logs.py
```

This is a backport of [[bitcoin/bitcoin#17691 | core#17691]] [2/2]

Before:
```
$ ./contrib/devtools/copyright_header.py report . | grep zero
  57 with zero copyrights
```

After:
```
$ ./contrib/devtools/copyright_header.py report . | grep zero
  43 with zero copyrights
```

Test Plan: `./contrib/devtools/copyright_header.py report .`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9815
deadalnix pushed a commit to Bitcoin-ABC/secp256k1 that referenced this pull request Jul 21, 2021
Summary:
Scripted diff:
```
s() { contrib/devtools/copyright_header.py insert "$1"; }

s contrib/devtools/circular-dependencies.py
s doc/man/gen-manpages.sh
s cmake/utils/filter-lcov.py
s contrib/gitian-build.py
s src/crypto/sha256_avx2.cpp
s src/crypto/sha256_sse41.cpp
s src/qt/test/addressbooktests.cpp
s src/qt/test/addressbooktests.h
s src/qt/test/util.cpp
s src/qt/test/util.h
s src/qt/test/wallettests.cpp
s src/qt/test/wallettests.h
s src/test/blockchain_tests.cpp
s test/functional/combine_logs.py
```

This is a backport of [[bitcoin/bitcoin#17691 | core#17691]] [2/2]

Before:
```
$ ./contrib/devtools/copyright_header.py report . | grep zero
  57 with zero copyrights
```

After:
```
$ ./contrib/devtools/copyright_header.py report . | grep zero
  43 with zero copyrights
```

Test Plan: `./contrib/devtools/copyright_header.py report .`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9815
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants