Thread (3 messages) flat view 3 messages, 3 authors, 2017-08-14

Re: [PATCH v2 2/2] Makefile: add style build rule

From: Stefan Beller <hidden>
Date: 2017-08-14 22:29:27

On Mon, Aug 14, 2017 at 3:25 PM, Junio C Hamano [off-list ref] wrote:
Brandon Williams [off-list ref] writes:
quoted
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 <redacted>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index ba4359ef8..acfd096b7 100644
--- a/Makefile
+++ b/Makefile
@@ -2414,6 +2414,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
Did we get "git clang-format" subcommand, or is "s/git //" implied
somewhere?
You need to have clang-format installed (debian/Ubuntu package, or
however it is named in your distribution), which provides this command
for us.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help