Skip to content

Commit

Permalink
clang-format-diff: compare to most recent tag on current branch (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
reimerix authored Dec 19, 2020
1 parent 75d1b2f commit dd161e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ClangFormat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ function(swift_setup_clang_format)
create_clang_format_targets(
TOP_LEVEL ${top_level_project}
ALL_COMMAND git ls-files ${patterns} | xargs ${${PROJECT_NAME}_CLANG_FORMAT} -i
DIFF_COMMAND git diff --diff-filter=ACMRTUXB --name-only --line-prefix=`git rev-parse --show-toplevel`/ HEAD -- ${patterns}
| xargs -t ${${PROJECT_NAME}_CLANG_FORMAT} -i
DIFF_COMMAND git describe --tags --abbrev=0 --always
| xargs -I % git diff --diff-filter=ACMRTUXB --name-only --line-prefix=`git rev-parse --show-toplevel`/ % -- ${patterns}
| xargs ${${PROJECT_NAME}_CLANG_FORMAT} -i
)
endfunction()

0 comments on commit dd161e3

Please sign in to comment.