summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/docs/ClangFormat.rst6
-rwxr-xr-xclang/tools/clang-format/clang-format-diff.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/clang/docs/ClangFormat.rst b/clang/docs/ClangFormat.rst
index 3f8499b8cef..86c5ec5e587 100644
--- a/clang/docs/ClangFormat.rst
+++ b/clang/docs/ClangFormat.rst
@@ -177,5 +177,11 @@ So to reformat all the lines in the latest :program:`git` commit, just do:
git diff -U0 HEAD^ | clang-format-diff.py -i -p1
+In an SVN client, you can do:
+
+.. code-block:: console
+
+ svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
+
The :option:`-U0` will create a diff without context lines (the script would format
those as well).
diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py
index 376257b638d..d6d0d44a06b 100755
--- a/clang/tools/clang-format/clang-format-diff.py
+++ b/clang/tools/clang-format/clang-format-diff.py
@@ -15,9 +15,10 @@ ClangFormat Diff Reformatter
This script reads input from a unified diff and reformats all the changed
lines. This is useful to reformat all the lines touched by a specific patch.
-Example usage for git users:
+Example usage for git/svn users:
git diff -U0 HEAD^ | clang-format-diff.py -p1 -i
+ svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
"""
OpenPOWER on IntegriCloud