summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2019-01-27 22:10:20 -0800
committerMiran <narimiran@disroot.org>2019-01-28 07:10:20 +0100
commit5fa8a61a238c08bca12da272f71692f2f103b6d8 (patch)
tree7ea2d8cd7077b7b2e8d1d1d285f8ec8f5ccffda0
parent91b39f2219773a5905524d33c64248fa64603087 (diff)
downloadNim-5fa8a61a238c08bca12da272f71692f2f103b6d8.tar.gz
add git diff hints to help with reviews (#10435)
-rw-r--r--doc/contributing.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/contributing.rst b/doc/contributing.rst
index b89102a3b..3edf8352c 100644
--- a/doc/contributing.rst
+++ b/doc/contributing.rst
@@ -410,6 +410,26 @@ Code reviews
    saves time explaining the change or applying it; see also
    https://forum.nim-lang.org/t/4317
 
+2. When reviewing large diffs that may involve code moving around, github's interface
+   doesn't help much as it doesn't highlight moves. Instead you can use something
+   like this, see visual results `here <https://github.com/nim-lang/Nim/pull/10431#issuecomment-456968196>`_:
+
+   .. code-block:: sh
+
+      git fetch origin pull/10431/head && git checkout FETCH_HEAD
+      git show --color-moved-ws=allow-indentation-change --color-moved=blocks HEAD^
+
+3. In addition, you can view github-like diffs locally to identify what was changed
+   within a code block using `diff-highlight` or `diff-so-fancy`, eg:
+
+   .. code-block:: sh
+
+      # put this in ~/.gitconfig:
+      [core]
+        pager = "diff-so-fancy | less -R" # or: use: `diff-highlight`
+
+
+
 .. include:: docstyle.rst