aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-08-14 14:30:46 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-14 15:26:22 -0700
commit2118805b929a47887f2ded218c95a5a274e36aa0 (patch)
tree3bb4bfb3019049f2e2b8f7fdd08cac1fc2e24069 /Makefile
parent6134de6ac1819aff8445490dfee3fb29966803c5 (diff)
downloadgit-2118805b929a47887f2ded218c95a5a274e36aa0.tar.gz
git-2118805b929a47887f2ded218c95a5a274e36aa0.tar.xz
Makefile: add style build rule
Add the 'style' build rule which will run git-clang-format on the diff between HEAD and the current worktree. The result is a diff of suggested changes. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 461c845d3..8e5b2df99 100644
--- a/Makefile
+++ b/Makefile
@@ -2440,6 +2440,10 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
.PHONY: sparse $(SP_OBJ)
sparse: $(SP_OBJ)
+.PHONY: style
+style:
+ git clang-format --style file --diff --extensions c,h
+
check: common-cmds.h
@if sparse; \
then \