Skip to content

Commit

Permalink
Merge bitcoin#19258: doc: improve subtree check instructions
Browse files Browse the repository at this point in the history
a4a3fc4 doc: improve subtree check instructions (Sjors Provoost)

Pull request description:

  Running `git-subtree-check.sh` requires adding the subtree repository as a remote. I learned that several years ago and then forgot again.

  This PR also improves the error message if the subtree commit can't be found.

ACKs for top commit:
  laanwj:
    ACK a4a3fc4
  fanquake:
    ACK a4a3fc4 - this looks ok.

Tree-SHA512: 959bd923726c172d17f9f97f8a56988bf2df5a94d3131e5152a66150b941394cee9e82fdc6b86e09c0ba91d123a496599f07ca454212168d8d301738394c12c8
  • Loading branch information
laanwj committed Jul 9, 2020
2 parents cc9d09e + a4a3fc4 commit fd9db45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ Others are external projects without a tight relationship with our project. Chan
be sent upstream, but bugfixes may also be prudent to PR against Bitcoin Core so that they can be integrated
quickly. Cosmetic changes should be purely taken upstream.

There is a tool in `test/lint/git-subtree-check.sh` to check a subtree directory for consistency with
There is a tool in `test/lint/git-subtree-check.sh` ([instructions](../test/lint#git-subtree-checksh)) to check a subtree directory for consistency with
its upstream repository.

Current subtrees include:
Expand Down
6 changes: 6 additions & 0 deletions test/lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ maintained:
* for `src/crypto/ctaes`: https://github.com/bitcoin-core/ctaes.git (branch master)
* for `src/crc32c`: https://github.com/google/crc32c.git (branch master)

To do so, add the upstream repository as remote:

```
git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git
```

Usage: `git-subtree-check.sh DIR (COMMIT)`

`COMMIT` may be omitted, in which case `HEAD` is used.
Expand Down
2 changes: 1 addition & 1 deletion test/lint/git-subtree-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fi

# get the tree in the subtree commit referred to
if [ "d$(git cat-file -t $rev 2>/dev/null)" != dcommit ]; then
echo "subtree commit $rev unavailable: cannot compare" >&2
echo "subtree commit $rev unavailable: cannot compare. Did you add and fetch the remote?" >&2
exit
fi
tree_subtree=$(git show -s --format="%T" $rev)
Expand Down

0 comments on commit fd9db45

Please sign in to comment.