-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: Cleanup clientversion.cpp #18616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
3335ab4
to
098d26d
Compare
Rebased 3335ab4 -> 098d26d (pr18616.01 -> pr18616.02) due to the conflict with #18556. |
@dongcarl Mind looking into this? |
Concept ACK |
ACK 098d26d Built, run and tested on macOS Catalina 10.15.4 |
068bcc0Perhaps let's separate the pure-rename changes into another commit from the other changes? (I think the changes to 098d26dNot quite sure how this mechanism works here, and wasn't able to find a reference to it in the |
a) we set the Line 1 in 844d207
From the git docs:
b)
//! git will put "#define GIT_COMMIT_ID ..." on the next line inside archives.
|
It is still required: Lines 17 to 22 in 844d207
|
-BEGIN VERIFY SCRIPT- sed -i 's/\bDESC\b/GIT_TAG/' share/genbuild.sh sed -i 's/\bSUFFIX\b/GIT_COMMIT/g' share/genbuild.sh -END VERIFY SCRIPT-
Updated 098d26d -> 09ee167 (pr18616.02 -> pr18616.05, diff):
@dongcarl |
Code Review ACK 09ee167 Nit: personally, something like this in #ifdef BUILD_GIT_TAG
#define BUILD_DESC BUILD_GIT_TAG
#else
#define BUILD_BASE_DESC "v" STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) \
"." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD)
#ifdef BUILD_GIT_COMMIT
#define BUILD_DESC BUILD_BASE_DESC "-" BUILD_GIT_COMMIT
#elif defined(GIT_COMMIT_ID)
#define BUILD_DESC BUILD_BASE_DESC "-g" GIT_COMMIT_ID
#else
#define BUILD_DESC BUILD_BASE_DESC "-unk"
#endif
#endif
const std::string CLIENT_BUILD(BUILD_DESC); |
Updated 09ee167 -> c269e61 (pr18616.05 -> pr18616.06, diff): |
FYI: I tested a branch with both this and my changes in #18741, builds passed fine! |
Yup! ACK c269e61 |
c269e61 Drop unused GIT_COMMIT_DATE macro (Hennadii Stepanov) 8f9f4ba refactor: Remove duplicated code (Hennadii Stepanov) 35f1189 build: Rename BUILD_* macros and the code self-descriptive (Hennadii Stepanov) dc1fba9 scripted-diff: Rename share/genbuild.sh macros to more meaningful ones (Hennadii Stepanov) 1e06bb6 Drop unused CLIENT_VERSION_SUFFIX macro (Hennadii Stepanov) Pull request description: This PR: - removes unused macros and duplicated code - renames macros in a way, that makes the code self-descriptive. ACKs for top commit: dongcarl: Yup! ACK c269e61 Tree-SHA512: c469f6269b578ccfae33d960e317eca8efaf27d49638f4c3830948c11b12ef728494d7e18c31e4a410945b7d83af5b246c7b83661b4eca17cf41ee4c4583649b
Summary: > Drop unused CLIENT_VERSION_SUFFIX macro > scripted-diff: Rename share/genbuild.sh macros to more meaningful ones > > -BEGIN VERIFY SCRIPT- > sed -i 's/\bDESC\b/GIT_TAG/' share/genbuild.sh > sed -i 's/\bSUFFIX\b/GIT_COMMIT/g' share/genbuild.sh > -END VERIFY SCRIPT- > build: Rename BUILD_* macros and the code self-descriptive > refactor: Remove duplicated code > Drop unused GIT_COMMIT_DATE macro This is a backport of Core [[bitcoin/bitcoin#18616 | PR18616]] Test Plan: ``` grep -r CLIENT_VERSION_SUFFIX src/ grep -r GIT_COMMIT_DATE src/ mkdir build cd build cmake .. -GNinja ninja all check-all ``` Testing the version number: `cmake .. -GNinja && ninja && src/bitcoind -h | grep version` It should display something like `v0.22.13-ba26a24e0` or `v0.22.13-ba26a24e0-dirty` (dirty tree) Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D9099
c269e61 Drop unused GIT_COMMIT_DATE macro (Hennadii Stepanov) 8f9f4ba refactor: Remove duplicated code (Hennadii Stepanov) 35f1189 build: Rename BUILD_* macros and the code self-descriptive (Hennadii Stepanov) dc1fba9 scripted-diff: Rename share/genbuild.sh macros to more meaningful ones (Hennadii Stepanov) 1e06bb6 Drop unused CLIENT_VERSION_SUFFIX macro (Hennadii Stepanov) Pull request description: This PR: - removes unused macros and duplicated code - renames macros in a way, that makes the code self-descriptive. ACKs for top commit: dongcarl: Yup! ACK c269e61 Tree-SHA512: c469f6269b578ccfae33d960e317eca8efaf27d49638f4c3830948c11b12ef728494d7e18c31e4a410945b7d83af5b246c7b83661b4eca17cf41ee4c4583649b
c269e61 Drop unused GIT_COMMIT_DATE macro (Hennadii Stepanov) 8f9f4ba refactor: Remove duplicated code (Hennadii Stepanov) 35f1189 build: Rename BUILD_* macros and the code self-descriptive (Hennadii Stepanov) dc1fba9 scripted-diff: Rename share/genbuild.sh macros to more meaningful ones (Hennadii Stepanov) 1e06bb6 Drop unused CLIENT_VERSION_SUFFIX macro (Hennadii Stepanov) Pull request description: This PR: - removes unused macros and duplicated code - renames macros in a way, that makes the code self-descriptive. ACKs for top commit: dongcarl: Yup! ACK c269e61 Tree-SHA512: c469f6269b578ccfae33d960e317eca8efaf27d49638f4c3830948c11b12ef728494d7e18c31e4a410945b7d83af5b246c7b83661b4eca17cf41ee4c4583649b
c269e61 Drop unused GIT_COMMIT_DATE macro (Hennadii Stepanov) 8f9f4ba refactor: Remove duplicated code (Hennadii Stepanov) 35f1189 build: Rename BUILD_* macros and the code self-descriptive (Hennadii Stepanov) dc1fba9 scripted-diff: Rename share/genbuild.sh macros to more meaningful ones (Hennadii Stepanov) 1e06bb6 Drop unused CLIENT_VERSION_SUFFIX macro (Hennadii Stepanov) Pull request description: This PR: - removes unused macros and duplicated code - renames macros in a way, that makes the code self-descriptive. ACKs for top commit: dongcarl: Yup! ACK c269e61 Tree-SHA512: c469f6269b578ccfae33d960e317eca8efaf27d49638f4c3830948c11b12ef728494d7e18c31e4a410945b7d83af5b246c7b83661b4eca17cf41ee4c4583649b
c269e61 Drop unused GIT_COMMIT_DATE macro (Hennadii Stepanov) 8f9f4ba refactor: Remove duplicated code (Hennadii Stepanov) 35f1189 build: Rename BUILD_* macros and the code self-descriptive (Hennadii Stepanov) dc1fba9 scripted-diff: Rename share/genbuild.sh macros to more meaningful ones (Hennadii Stepanov) 1e06bb6 Drop unused CLIENT_VERSION_SUFFIX macro (Hennadii Stepanov) Pull request description: This PR: - removes unused macros and duplicated code - renames macros in a way, that makes the code self-descriptive. ACKs for top commit: dongcarl: Yup! ACK c269e61 Tree-SHA512: c469f6269b578ccfae33d960e317eca8efaf27d49638f4c3830948c11b12ef728494d7e18c31e4a410945b7d83af5b246c7b83661b4eca17cf41ee4c4583649b
This PR: