]> granicus.if.org Git - clang/commitdiff
clang-format: Add clang-format-diff usage examples for SVN.
authorDaniel Jasper <djasper@google.com>
Wed, 14 May 2014 09:36:11 +0000 (09:36 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 14 May 2014 09:36:11 +0000 (09:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208766 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ClangFormat.rst
tools/clang-format/clang-format-diff.py

index 3f8499b8cefba301050d79d827245fbae39476c6..86c5ec5e58737e33b6b455a139f50121a1834eed 100644 (file)
@@ -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).
index 376257b638dc1f1ccc449237ff83966c13015e97..d6d0d44a06bb29278373000e7835c154bb299ef8 100755 (executable)
@@ -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
 
 """