mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-23 22:15:37 +02:00
Merge #15348: doc: Add separate productivity notes document
5b76c314d6
doc: Add separate productivity notes document (Carl Dong)
Pull request description:
Many developers have their own tools and tricks to be more productive
during their cycles, so let's document the best ones so that everyone
can benefit from them.
Tree-SHA512: b4989e7a815e972a9a646f448fb6c08bd896b4bce77fd7fb22a71a7602971d4cbe34f88183f503f5b851d002784d9e91b87df5348c661eeb9cefa69c52e0de2b
This commit is contained in:
@@ -844,54 +844,6 @@ would be to revert the upstream fix before applying the updates to Bitcoin's
|
||||
copy of LevelDB. In general you should be wary of any upstream changes affecting
|
||||
what data is returned from LevelDB queries.
|
||||
|
||||
Git and GitHub tips
|
||||
---------------------
|
||||
|
||||
- For resolving merge/rebase conflicts, it can be useful to enable diff3 style using
|
||||
`git config merge.conflictstyle diff3`. Instead of
|
||||
|
||||
<<<
|
||||
yours
|
||||
===
|
||||
theirs
|
||||
>>>
|
||||
|
||||
you will see
|
||||
|
||||
<<<
|
||||
yours
|
||||
|||
|
||||
original
|
||||
===
|
||||
theirs
|
||||
>>>
|
||||
|
||||
This may make it much clearer what caused the conflict. In this style, you can often just look
|
||||
at what changed between *original* and *theirs*, and mechanically apply that to *yours* (or the other way around).
|
||||
|
||||
- When reviewing patches which change indentation in C++ files, use `git diff -w` and `git show -w`. This makes
|
||||
the diff algorithm ignore whitespace changes. This feature is also available on github.com, by adding `?w=1`
|
||||
at the end of any URL which shows a diff.
|
||||
|
||||
- When reviewing patches that change symbol names in many places, use `git diff --word-diff`. This will instead
|
||||
of showing the patch as deleted/added *lines*, show deleted/added *words*.
|
||||
|
||||
- When reviewing patches that move code around, try using
|
||||
`git diff --patience commit~:old/file.cpp commit:new/file/name.cpp`, and ignoring everything except the
|
||||
moved body of code which should show up as neither `+` or `-` lines. In case it was not a pure move, this may
|
||||
even work when combined with the `-w` or `--word-diff` options described above.
|
||||
|
||||
- When looking at other's pull requests, it may make sense to add the following section to your `.git/config`
|
||||
file:
|
||||
|
||||
[remote "upstream-pull"]
|
||||
fetch = +refs/pull/*:refs/remotes/upstream-pull/*
|
||||
url = git@github.com:bitcoin/bitcoin.git
|
||||
|
||||
This will add an `upstream-pull` remote to your git repository, which can be fetched using `git fetch --all`
|
||||
or `git fetch upstream-pull`. Afterwards, you can use `upstream-pull/NUMBER/head` in arguments to `git show`,
|
||||
`git checkout` and anywhere a commit id would be acceptable to see the changes from pull request NUMBER.
|
||||
|
||||
Scripted diffs
|
||||
--------------
|
||||
|
||||
|
Reference in New Issue
Block a user