diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py --- a/clang/tools/clang-format/clang-format-diff.py +++ b/clang/tools/clang-format/clang-format-diff.py @@ -13,9 +13,13 @@ lines. This is useful to reformat all the lines touched by a specific patch. Example usage for git/svn users: - git diff -U0 --no-color HEAD^ | clang-format-diff.py -p1 -i + git diff -U0 --no-color --relative HEAD^ | clang-format-diff.py -p1 -i svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i +It should be noted that the filename contained in the diff is used unmodified +to determine the source file to update. Users calling this script directly +should be careful to ensure that the path in the diff is correct relative to the +current working directory. """ from __future__ import absolute_import, division, print_function