Move util files to directory #14555

pull jimpo wants to merge 1 commits into bitcoin:master from jimpo:util-cleanup changing 152 files +239 −239
  1. jimpo commented at 5:13 pm on October 23, 2018: contributor
    As discussed here, this establishes a util/ directory to introduce more organizational structure and have a clear place for new util files. It’s really not scary to review, it’s just one big scripted diff.
  2. MarcoFalke commented at 6:11 pm on October 23, 2018: member
    The scripted diff will also run on non-git files that happen to be in the folder. Imo, this should be avoided by using a git ls-files with a filter or something.
  3. DrahtBot commented at 9:58 pm on October 23, 2018: member
    • #14585 (refactor: remove usage of locale dependent std::isspace by practicalswift)
    • #14530 (Use RPCHelpMan to generate RPC doc strings by MarcoFalke)
    • #14521 (qt, docs: Fix bitcoin-qt -version output formatting by hebasto)
    • #14384 (Resolve validationinterface circular dependencies by 251Labs)
    • #14224 (Document intentional and unintentional unsigned integer overflows (wraparounds) using annotations by practicalswift)
    • #14047 (Add HKDF_HMAC256_L32 and method to negate a private key by jonasschnelli)
    • #14045 (refactor: Fix the chainparamsbase -> util circular dependency by Empact)
    • #14035 (Utxoscriptindex by mgrychow)
    • #13815 (util: Add [[nodiscard]] to all {Decode,Parse} functions returning bool by practicalswift)
    • #13751 (Utils and libraries: Drops the boost/algorithm/string/split.hpp dependency by 251Labs)
    • #13746 (-masterdatadir for datadir bootstrapping by kallewoof)
    • #12677 (RPC: Add ancestor{count,size,fees} to listunspent output by luke-jr)
    • #11785 (Raise the open fd limit to the maximum allowed by vii)
    • #10443 (Add fee_est tool for debugging fee estimation code by ryanofsky)

    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.

  4. fanquake added the label Utils/log/libs on Oct 23, 2018
  5. promag commented at 8:54 am on October 24, 2018: member
    IMO scripted diff commit could have the mv commands to avoid having a bad commit.
  6. jimpo force-pushed on Oct 25, 2018
  7. jimpo force-pushed on Oct 25, 2018
  8. jimpo force-pushed on Oct 25, 2018
  9. jimpo force-pushed on Oct 25, 2018
  10. ken2812221 commented at 4:00 am on October 25, 2018: contributor

    Could you please apply this as the second commit? Thanks

     0diff --git a/build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj b/build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj
     1index 0be7e7e43..2c6c0a8b7 100644
     2--- a/build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj
     3+++ b/build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj
     4@@ -40,7 +40,7 @@
     5     <ClCompile Include="..\..\src\script\script.cpp" />
     6     <ClCompile Include="..\..\src\script\script_error.cpp" />
     7     <ClCompile Include="..\..\src\uint256.cpp" />
     8-    <ClCompile Include="..\..\src\utilstrencodings.cpp" />
     9+    <ClCompile Include="..\..\src\util\strencodings.cpp" />
    10   </ItemGroup>
    11   <ItemGroup>
    12     <None Include="packages.config" />
    
  11. jimpo force-pushed on Oct 26, 2018
  12. ken2812221 commented at 9:19 am on October 26, 2018: contributor
    utACK d0f883e9c5c7dd1ac9efcd69eb0065e47376afef
  13. promag commented at 9:25 am on October 26, 2018: member
    utACK d0f883e, sorry conflicts..
  14. MarcoFalke commented at 11:40 am on October 26, 2018: member
    utACK d0f883e9c5c7dd1ac9efcd69eb0065e47376afef
  15. scravy commented at 11:43 am on October 26, 2018: contributor
    utACK d0f883e
  16. DrahtBot added the label Needs rebase on Oct 28, 2018
  17. meshcollider commented at 5:15 am on November 3, 2018: contributor
  18. jimpo force-pushed on Nov 4, 2018
  19. DrahtBot removed the label Needs rebase on Nov 4, 2018
  20. promag commented at 6:17 pm on November 4, 2018: member

    After rebase:

     0diff --git a/src/base58.cpp b/src/base58.cpp
     1index eac763394..e3d285339 100644
     2--- a/src/base58.cpp
     3+++ b/src/base58.cpp
     4@@ -6,7 +6,7 @@
     5 
     6 #include <hash.h>
     7 #include <uint256.h>
     8-#include <utilstrencodings.h>
     9+#include <util/strencodings.h>
    10 
    11 #include <assert.h>
    12 #include <string.h>
    
  21. scripted-diff: Move util files to separate directory.
    -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/utilmemory.h src/util/memory.h
    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 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
    sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
    sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
    sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
    sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
    
    sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
    sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h
    sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
    sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
    sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h
    
    sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
    sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am
    sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
    sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
    sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am
    
    sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh
    sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh
    sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
    sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
    sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj
    -END VERIFY SCRIPT-
    2068f089c8
  22. jimpo force-pushed on Nov 5, 2018
  23. ken2812221 commented at 7:13 am on November 5, 2018: contributor
    utACK 2068f089c8b7b90eb4557d3f67ea0f0ed2059a23
  24. fanquake commented at 8:52 am on November 5, 2018: member

    tACK 2068f08 make check and ran the functional tests.

    Might be a good to merge this now, to save the constant rebasing. Doesn’t look like this will break any ready to merge/PRs with ACKs etc.

  25. promag commented at 9:02 am on November 5, 2018: member
    Agree with @fanquake, ACK 2068f08.
  26. laanwj commented at 10:34 am on November 5, 2018: member

    utACK 2068f089c8b7b90eb4557d3f67ea0f0ed2059a23

    • util/system.h is great naming, yes, the file is for os/system utilities
    • We need to come up with guidelines (in the developer notes) what to put in src/compat versus src/support versus src/util, all three are more or less utilities. But that can be done later.
  27. laanwj merged this on Nov 5, 2018
  28. laanwj closed this on Nov 5, 2018

  29. laanwj referenced this in commit bccb4d29a8 on Nov 5, 2018
  30. kittywhiskers referenced this in commit 570a8885fc on Jun 15, 2021
  31. kittywhiskers referenced this in commit 110e20731f on Jun 15, 2021
  32. kittywhiskers referenced this in commit 1f328c1c8e on Jun 16, 2021
  33. kittywhiskers referenced this in commit 2350001a63 on Jun 25, 2021
  34. kittywhiskers referenced this in commit a4745a6aec on Jun 25, 2021
  35. kittywhiskers referenced this in commit 1c91ce508f on Jun 27, 2021
  36. kittywhiskers referenced this in commit ef4dfa8524 on Jun 27, 2021
  37. UdjinM6 referenced this in commit 7d664c7c53 on Jun 27, 2021
  38. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-28 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me