mirror of https://github.com/microsoft/clang.git
![]() Summary: When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits. This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory. There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead. Patch by Luis Hector Chavez! Reviewers: djasper, lodato Subscribers: lodato, cfe-commits, srhines Projects: #clang-c Differential Revision: https://reviews.llvm.org/D24319 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282136 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
arcmt-test | ||
c-arcmt-test | ||
c-index-test | ||
clang-check | ||
clang-format | ||
clang-format-vs | ||
clang-fuzzer | ||
clang-offload-bundler | ||
diag-build | ||
diagtool | ||
driver | ||
libclang | ||
scan-build | ||
scan-build-py | ||
scan-view | ||
CMakeLists.txt |