{"id":18581659,"url":"https://github.com/bitcoin-core/bitcoin-maintainer-tools","last_synced_at":"2025-04-12T18:48:33.826Z","repository":{"id":11357256,"uuid":"69343299","full_name":"bitcoin-core/bitcoin-maintainer-tools","owner":"bitcoin-core","description":"External repository for Bitcoin Core related maintenance tools","archived":false,"fork":false,"pushed_at":"2025-03-26T10:42:43.000Z","size":271,"stargazers_count":145,"open_issues_count":11,"forks_count":97,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-04-03T22:09:07.108Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitcoin-core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-27T09:58:15.000Z","updated_at":"2025-03-27T21:36:56.000Z","dependencies_parsed_at":"2023-01-11T20:16:32.540Z","dependency_job_id":"7b85c812-8362-4c8d-bbb1-b75922faef74","html_url":"https://github.com/bitcoin-core/bitcoin-maintainer-tools","commit_stats":{"total_commits":148,"total_committers":24,"mean_commits":6.166666666666667,"dds":0.7905405405405406,"last_synced_commit":"d49cea01382ecb9fe59d6ba1961f3e8afcb2dc77"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoin-core%2Fbitcoin-maintainer-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoin-core%2Fbitcoin-maintainer-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoin-core%2Fbitcoin-maintainer-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoin-core%2Fbitcoin-maintainer-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitcoin-core","download_url":"https://codeload.github.com/bitcoin-core/bitcoin-maintainer-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618087,"owners_count":21134197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T00:06:33.033Z","updated_at":"2025-04-12T18:48:33.801Z","avatar_url":"https://github.com/bitcoin-core.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"External repository for Bitcoin Core related maintenance tools.\n\ngithub-merge\n------------\n\nA small script to automate merging pull-requests securely and sign them with GPG.\n\nFor example, if the \"to\" repo is identical to the \"from\" repo:\n\n```bash\n./github-merge.py 1234\n```\n\n(in any git repository) will help you merge pull request #1234 for the configured repository.\n\nOtherwise, for a differing \"from\" repo:\n\n```bash\n./github-merge.py --repo-from=bitcoin-core/gui 1234\n```\n\nwill fetch the pull request from another monotree repository. Be sure to also set `githubmerge.pushmirrors` (see below).\n\nWhat it does:\n* Fetch master and the pull request.\n* Locally construct a merge commit.\n* Show the diff that merge results in.\n* Ask you to verify the resulting source tree (so you can do a make check or whatever).\n* Ask you whether to GPG sign the merge commit.\n* Ask you whether to push the result upstream.\n\nThis means that there are no potential race conditions (where a\npull request gets updated while you're reviewing it, but before you click\nmerge), and when using GPG signatures, that even a compromised GitHub\ncouldn't mess with the sources.\n\n### Setup\n\nConfiguring the github-merge tool for the bitcoin repository is done in the following way:\n\n    git config githubmerge.repository bitcoin/bitcoin\n    git config githubmerge.pushmirrors \"git@github.com:bitcoin-core/gui.git,git@github.com:YourPrivateMirror/bitcoin-core.git\"\n    git config githubmerge.testcmd \"make -j4 check\" (adapt to whatever you want to use for testing)\n    git config --global user.signingkey mykeyid\n\nIf you want to use HTTPS instead of SSH for accessing GitHub, you need set the host additionally:\n\n    git config githubmerge.host \"https://github.com\"  (default is \"git@github.com\", which implies SSH)\n\n### Authentication (optional)\n\nThe API request limit for unauthenticated requests is quite low, but the\nlimit for authenticated requests is much higher. If you start running\ninto rate limiting errors it can be useful to set an authentication token\nso that the script can authenticate requests.\n\n- First, go to [Personal access tokens](https://github.com/settings/tokens).\n- Click 'Generate new token'.\n- Fill in an arbitrary token description. No further privileges are needed.\n- Click the `Generate token` button at the bottom of the form.\n- Copy the generated token (should be a hexadecimal string)\n\nThen do:\n\n    git config --global user.ghtoken \"pasted token\"\n\n### Create and verify timestamps of merge commits\n\nTo create or verify timestamps on the merge commits, install the OpenTimestamps\nclient via `pip3 install opentimestamps-client`. Then, download the gpg wrapper\n`ots-git-gpg-wrapper.sh` and set it as git's `gpg.program`. See\n[the ots git integration documentation](https://github.com/opentimestamps/opentimestamps-client/blob/master/doc/git-integration.md#usage)\nfor further details.\n\nupdate-translations\n-------------------\n\nRun this script from the root of a repository to update all translations from Transifex.\nIt will do the following automatically:\n\n- Fetch all translations\n- Post-process them into valid and committable format\n- Add missing translations to the build system (TODO)\n\nTo be able to pull translation files from the Transifex website, it needs\nthe [Transifex CLI](https://github.com/transifex/cli).\n\nclang-format\n------------\n\nA script to format cpp source code according to the .clang-format file in the bitcoin repo.\nThis should only be applied to new files or files which are currently not actively developed on.\nAlso, git subtrees are not subject to formatting.\n\nNote: The script is currently untested and unmaintained, but kept for archival reasons, in\ncase it is planned to be used some day.\n\nbuild-for-compare\n--------------------\n\nBuild for binary comparison.\n\nSee `build-for-compare.py --help` for more information.\n\nBuilds from current directory, which is assumed to be a git clone of the bitcoin repository.\n\n**DO NOT RUN this with the nocopy=1 flag set on working tree if you have any local additions, it will nuke all\nnon-repository files, multiple times over. By leaving nocopy off (default) the git tree is copied to a temporary\ndirectory and all operations are performed there.**\n\nExample:\n```bash\ngit clone https://github.com/bitcoin/bitcoin.git bitcoin-compare\ncd bitcoin-compare\n../bitcoin-maintainer-tools/build-for-compare.py 4731cab 2f71490\nsha256sum /tmp/compare/bitcoind.*.stripped\ngit diff -W --word-diff /tmp/compare/4731cab /tmp/compare/2f71490\n```\n\nbackport\n--------\n\nScript to backport pull requests in order of merge, to minimize number of conflicts.\nPull ids are listed in `to_backport.txt` or given on the command line, and they must be prefixed\nwith the repository name, e.g.:\n\n```bash\n../bitcoin-maintainer-tools/backport.py bitcoin/bitcoin#21907 bitcoin-core/gui#277 bitcoin-core/gui#365\n\n```\n\nRequires `pip3 install gitpython` or similar.\n\nunittest-statistics\n--------------------------\n\n`unittest-statistics.py` can be used to print a table of the slowest 20 unit tests.\n\nUsage:\n```bash\nunittest-statistics.py \u003c/path/to/test_bitcoin\u003e [\u003csubtest\u003e]\n```\n\nFor example:\n```bash\nunittest-statistics.py src/test/test_bitcoin wallet_tests\n```\n\ntreehash512\n--------------\n\nThis script will show the SHA512 tree has for a certain commit, or HEAD\nby default.\n\nUsage:\n\n```bash\ntreehash512.py [\u003ccommithash\u003e]\n```\n\nThis should match the Tree-SHA512 commit metadata field added by\ngithub-merge.\n\nsignoff\n----------\n\nThis is an utility to manually add a treehash to the HEAD commit and then\ngpg-sign it. This is useful when there is the need to manually add a commit.\n\nUsage:\n\n```bash\nsignoff.py\n```\n(no command line arguments)\n\nWhen there is already a treehash on the HEAD commit, it is compared against\nwhat is computed. If this matches, it continues. If the treehash mismatches an\nerror is thrown. If there is no treehash it adds the \"Tree-SHA512:\" header with\nthe computed hash to the commit message.\n\nAfter making sure the treehash is correct it verifies whether the commit is\nsigned. If so it just displays the signature, if not, it is signed.\n\nsubtree updates\n---------------\n\nBitcoin Core comes with several subtrees (c.f. https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh)\nTo update the subtree, make sure to fetch the remote of the subtree.\nThen a simple call should pull in and squash the changes:\n\n```sh\ngit subtree pull --prefix src/${prefix} ${remote_repo} ${ref} --squash\n```\n\nFor setting up a subtree, refer to `git help subtree`.\n\ncheck-dnsseeds\n---------------\n\nSanity-check the DNS seeds used by Bitcoin Core.\n\nUsage:\n\n```bash\ncheck-dnsseeds.py\n```\n\nExample output:\n\n```bash\n* Mainnet\nOK   seed.bitcoin.sipa.be (40 results)\nOK   dnsseed.bluematt.me (33 results)\nFAIL dnsseed.bitcoin.dashjr.org\nOK   seed.bitcoinstats.com (50 results)\nOK   seed.bitcoin.jonasschnelli.ch (38 results)\nOK   seed.btc.petertodd.org (23 results)\nOK   seed.bitcoin.sprovoost.nl (35 results)\nOK   dnsseed.emzy.de (41 results)\n\n* Testnet\nOK   testnet-seed.bitcoin.jonasschnelli.ch (36 results)\nOK   seed.tbtc.petertodd.org (38 results)\nOK   testnet-seed.bluematt.me (5 results)\n```\n\ndelete non-reduced fuzz inputs\n------------------------------\n\nRefer to the documentation inside the script.\n\nfastcopy-chaindata\n-------------------\n\nFast local copy of Bitcoin Core blockchain state.\n\n```bash\nfastcopy-chaindata.py ~/.bitcoin /path/to/temp/datadir\n```\n\nThis utility hardlinks all but the last block data file (rev and blk),\nand hardlinks all .ldb files to the destination. The last data files as well\nas the other leveldb data files (such as the log) are copied.\n\nThis relies on the fact that block files (except the last) and ldb files\nare read-only once they are written.\n\nWarning: Hardlinking only works within a filesystem, and may not work for all\nfilesystems.\n\nlist-pulls\n----------\n\nScript to parse git commit list, extract github issues to create a changelog in\ntext and json format.\n\nRun this in the root directory of the repository.\n\nThis requires an up-to-date checkout of https://github.com/zw/bitcoin-gh-meta.git\nin the parent directory, or environment variable `GHMETA`.\n\nIt takes a range of commits and a .json file of PRs to exclude, for\nexample if these are already backported in a minor release. This can be the pulls.json\ngenerated from a previous release.\n\nExample usage:\n\n    ../maintainer-tools/list-pulls.py v0.18.0 0.19 relnot/pulls-exclude.json \u003e relnot/pulls.md\n\nThe output of this script is a first draft based on rough heuristics, and\nlikely needs to be extensively manually edited before ending up in the release\nnotes.\n\nmake-tag\n--------\n\nMake a new release tag, performing a few checks.\n\nUsage: `make-tag.py \u003ctag\u003e`.\n\nghwatch\n-------\n\nThis is a script to watch your github notifications in the terminal. It will show a table that is refreshed every 10 minutes (configurable). It can be exited by pressing \u003ckbd\u003eESC\u003c/kbd\u003e or \u003ckbd\u003eCtrl-C\u003c/kbd\u003e.\n\n### Dependencies\n\nThe `github` python module is a required dependency for github API access. This can be installed for your user using `pip3 install --user PyGithub`, or globally using your distribution's package manager e.g. `apt-get install python3-github`.\n\n### Configuration\n\nTo generate a default configuration file in `~/.config/ghwatch/ghwatch.conf` do\n\n```\n./ghwatch.py --default-config\n```\n\nThen, edit the configuration file. Only thing that is necessary to change is `ghtoken`. You will need to create a github [authentication token](https://github.com/settings/tokens) then insert it here:\n\n```\n    \"ghtoken\": \"\u003ctoken from github\u003e\",\n```\n\nDepending on your browser preference you might want to change `browser`, this is the command that will be invoked when clicking on an issue number. It defaults to `null` which indicates to use the system web browser.\n\nIf you want to see PR status (and other issue details like labels), point `meta` for the `bitcoin/bitcoin` repository to an up-to-date checkout of [bitcoin-gh-meta](https://github.com/zw/bitcoin-gh-meta).\n```\n    \"meta\": {\n        \"bitcoin/bitcoin\": \"/path/to/bitcoin-gh-meta\"\n    },\n```\n\nTo keep this repository up to date you can set the interval in seconds in 'auto_update', default is 0 (i.e. no automatic update). Be aware that [bitcoin-gh-meta](https://github.com/zw/bitcoin-gh-meta) is being refreshed every two hours (7200 seconds).\n\nSorting the notifications by {reason, time} can be enabled with the 'sort_notifications' boolean field (default=false).\n\nBy editing the `label_prio` structure it is possible to affect what labels will be shown. The first label encountered in this list for an issue in the associated repository will be shown as the label in the table.\n\n### Command-line options\n\nSome other settings can be set through command line options. See `./ghwatch.py --help` for the list of command line options and their descriptions.\n\n### Display\n\nMost of the columns are self-explanatory, except for:\n\n- `r` this [notification reason](https://docs.github.com/en/rest/reference/activity#notification-reasons) from the GH API as a two-letter code. This can be:\n  - `as` assign\n  - `au` author\n  - `co` comment\n  - `in` invitation\n  - `ma` manual\n  - `me` mention\n  - `rr` review requested\n  - `sa` security alert\n  - `sc` state change\n  - `su` subscribed\n  - `tm` team mention\n- `k` the kind of notification as a letter. This can be:\n  - `P` pull request\n  - `I` issue\n  - `C` commit\n\n### Controls\n\nLeft-click on a PR number to show details in a web browser.\n\nThe program can be exited by pressing \u003ckbd\u003eESC\u003c/kbd\u003e or \u003ckbd\u003eCtrl-C\u003c/kbd\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoin-core%2Fbitcoin-maintainer-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcoin-core%2Fbitcoin-maintainer-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoin-core%2Fbitcoin-maintainer-tools/lists"}