Skip to content

Commit 344581c

Browse files
committed
Merge #1528: docs: add github-merge.py process for merging PRs
8f28d82 docs: add github-merge.py process for merging PRs (Byron Hambly) Pull request description: Documents how to merge PRs using the github-merge.py script from Bitcoin maintainer tools repo. ACKs for top commit: psgreco: ACK 8f28d82 Tree-SHA512: b263dd7715fa71926ceeae053e453a4a19b64fa89c88cb0f84fa15bafbcc1051f35ca4f28a05f41dfc8d3af1d1de9eb2bb6cd832867cf7d7d7772a3c7267777b
2 parents e360a96 + 8f28d82 commit 344581c

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

doc/github-merge-script.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# github-merge.py
2+
3+
Please use this python script from the [Bitcoin maintainer tools](https://github.com/bitcoin-core/bitcoin-maintainer-tools/) repo for merging PRs.
4+
5+
- Clone the repo and copy or just download the [github-merge.py](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/github-merge.py) script into a directory on your $PATH.
6+
7+
```
8+
wget https://raw.githubusercontent.com/bitcoin-core/bitcoin-maintainer-tools/refs/heads/main/github-merge.py -O ~/.local/bin/github-merge.py
9+
chmod +x ~/.local/bin/github-merge.py
10+
```
11+
12+
- In your Elements repo, configure the merge repository.
13+
14+
```
15+
git config githubmerge.repository ElementsProject/elements
16+
```
17+
18+
- Run the script with the PR number you want to test/merge.
19+
20+
```
21+
github-merge.py <PR_NUMBER>
22+
```
23+
24+
For example for PR 1518 I see this output:
25+
26+
```
27+
ElementsProject/elements#1518 Avoid Simplicity header dependency propogation into master
28+
* 6c7788adf373cd8f0dc5c4fe2b7674625631721e Avoid Simplicity header dependency propogation (Russell O'Connor) (upstream/simplicity, pull/1518/head)
29+
30+
Dropping you on a shell so you can try building/testing the merged source.
31+
Run 'git diff HEAD~' to show the changes being merged.
32+
Type 'exit' when done.
33+
```
34+
35+
- Now you can build and test the PR branch, or do whatever review/testing you require.
36+
37+
- Once you are done testing, comment on the PR with your `ACK BRANCH_COMMIT` and/or comments.
38+
39+
Note: this merge script requires one or more ACKs on the top commit of the PR.
40+
41+
- Type `exit` to continue after testing.
42+
43+
```
44+
exit
45+
```
46+
47+
In our example this results in the following output:
48+
49+
```
50+
[pull/1518/local-merge 5e1a950e52] Merge ElementsProject/elements#1518: Avoid Simplicity header dependency propogation
51+
Date: Thu Jan 22 14:49:26 2026 +0200
52+
ElementsProject/elements#1518 Avoid Simplicity header dependency propogation into master
53+
* 6c7788adf373cd8f0dc5c4fe2b7674625631721e Avoid Simplicity header dependency propogation (Russell O'Connor) (upstream/simplicity, pull/1518/head)
54+
ACKs:
55+
* ACK 6c7788a; built and tested locally (delta1)
56+
* ACK 6c7788adf373cd8f0dc5c4fe2b7674625631721e; successfully ran local tests (apoelstra)
57+
Type 's' to sign off on the above merge, or 'x' to reject and exit.
58+
```
59+
60+
- If all looks good then type `s` and hit enter to sign off on the merge. Otherwise type `x` and hit enter to exit.
61+
62+
Signing off in our example shows this output:
63+
64+
```
65+
Type 'push' to push the result to git@github.com:ElementsProject/elements, branch master, or 'x' to exit without pushing.
66+
```
67+
68+
- Type `push` and hit enter to finish the merge.

0 commit comments

Comments
 (0)