Skip to content

Commit 90ab62c

Browse files
committed
[docs] document scripted-diff
1 parent 94c9015 commit 90ab62c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/developer-notes.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,26 @@ Git and GitHub tips
549549
or `git fetch upstream-pull`. Afterwards, you can use `upstream-pull/NUMBER/head` in arguments to `git show`,
550550
`git checkout` and anywhere a commit id would be acceptable to see the changes from pull request NUMBER.
551551

552+
Scripted diffs
553+
--------------
554+
555+
For reformatting and refactoring commits where the changes can be easily automated using a bash script, we use
556+
scripted-diff commits. The bash script is included in the commit message and our Travis CI job checks that
557+
the result of the script is identical to the commit. This aids reviewers since they can verify that the script
558+
does exactly what it's supposed to do. It is also helpful for rebasing (since the same script can just be re-run
559+
on the new master commit).
560+
561+
To create a scripted-diff:
562+
563+
- start the commit message with `scripted-diff:` (and then a description of the diff on the same line)
564+
- in the commit message include the bash script between lines containing just the following text:
565+
- `-BEGIN VERIFY SCRIPT-`
566+
- `-END VERIFY SCRIPT-`
567+
568+
The scripted-diff is verified by the tool `contrib/devtools/commit-script-check.sh`
569+
570+
Commit `bb81e173` is an example of a scripted-diff.
571+
552572
RPC interface guidelines
553573
--------------------------
554574

0 commit comments

Comments
 (0)