Skip to content
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

scripted-diff: Move util files to separate directory. #6043

Merged

Conversation

nuttycom
Copy link
Contributor

@nuttycom nuttycom commented Jul 1, 2022

Backport of bitcoin/bitcoin#14555

See the scripted diff in the commit.

-BEGIN VERIFY SCRIPT-
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp

sed -i -e 's/"util\.h"/"util\/system\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
git checkout HEAD -- src/secp256k1 # exclude secp256k1, which has its own "util.h"
sed -i -e 's/"utilmoneystr\.h"/"util\/moneystr\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/"utilstrencodings\.h"/"util\/strencodings\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/"utiltime\.h"/"util\/time\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')

sed -i -e 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
sed -i -e 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
sed -i -e 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
sed -i -e 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h

sed -i -e 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
sed -i -e 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
sed -i -e 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
sed -i -e 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am

sed -i -e 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i -e 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i -e 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
-END VERIFY SCRIPT-
@nuttycom nuttycom force-pushed the backport/14555-move_util_files_to_dir branch from 07568e3 to 9a7e2c1 Compare July 1, 2022 23:52
@nuttycom nuttycom added the safe-to-build Used to send PR to prod CI environment label Jul 1, 2022
daira
daira previously approved these changes Jul 2, 2022
Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

utACK

@daira
Copy link
Contributor

daira commented Jul 2, 2022

Note: scripts should be in the commit they apply to, not the message that goes into the merge commit. I reviewed the latter before realising the former is what would be checked.

@nuttycom
Copy link
Contributor Author

nuttycom commented Jul 3, 2022

Note: scripts should be in the commit they apply to, not the message that goes into the merge commit. I reviewed the latter before realising the former is what would be checked.

Yeah, the script is in the commit, it just got automatically copied into the PR since this is a single-commit PR. Thanks for editing the top post.

@nuttycom nuttycom marked this pull request as draft July 5, 2022 14:39
@nuttycom nuttycom marked this pull request as ready for review July 6, 2022 15:34
str4d
str4d previously approved these changes Jul 6, 2022
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK 9a7e2c1 with non-blocking question.

src/Makefile.am Show resolved Hide resolved
src/Makefile.am Outdated Show resolved Hide resolved
-BEGIN VERIFY SCRIPT-
git mv src/utiltest.h src/util/test.h
git mv src/utiltest.cpp src/util/test.cpp
sed -i -e 's/"utiltest\.h"/"util\/test\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/ZCASH_UTILTEST_H/ZCASH_UTIL_TEST_H/g' src/util/test.h
sed -i -e 's/utiltest\.\(h\|cpp\)/util\/test\.\1/g' src/Makefile.am
-END VERIFY SCRIPT-
@nuttycom nuttycom dismissed stale reviews from str4d and daira via 71b6a59 July 6, 2022 16:28
@nuttycom nuttycom added C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. safe-to-build Used to send PR to prod CI environment and removed safe-to-build Used to send PR to prod CI environment labels Jul 6, 2022
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK 71b6a59

@nuttycom nuttycom merged commit e03b964 into zcash:master Jul 6, 2022
@nuttycom nuttycom deleted the backport/14555-move_util_files_to_dir branch July 6, 2022 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. safe-to-build Used to send PR to prod CI environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants