]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: add style build rule
authorBrandon Williams <bmwill@google.com>
Mon, 14 Aug 2017 21:30:46 +0000 (14:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Aug 2017 22:26:22 +0000 (15:26 -0700)
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>
Makefile

index 461c845d33cbc5f201096ea4b3e1048492cb0a6a..8e5b2df999b08420c038c05cdc7feb88530a0ab3 100644 (file)
--- 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 \