[Bf-blender-cvs] [06330d80edc] temp-clang-format: Add clang-format-edited.sh

Campbell Barton noreply at git.blender.org
Mon Jan 7 07:31:58 CET 2019


Commit: 06330d80edce92f860fcd946aee445c1f8a212b0
Author: Campbell Barton
Date:   Mon Jan 7 17:31:02 2019 +1100
Branches: temp-clang-format
https://developer.blender.org/rB06330d80edce92f860fcd946aee445c1f8a212b0

Add clang-format-edited.sh

Format files which have differences from HEAD.

===================================================================

A	clang-format-edited.sh
M	clang-format-migration.sh

===================================================================

diff --git a/clang-format-edited.sh b/clang-format-edited.sh
new file mode 100755
index 00000000000..d56c420fb90
--- /dev/null
+++ b/clang-format-edited.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+FILES=$(git diff --name-only source/ | egrep \\.\(c\|cc\|cpp\|cxx\|h\|hh\|hpp\|hxx\|m\|mm\)$)
+
+if [ -z "$FILES" ]; then
+	echo "Nothing to clang-format, exiting!"
+	exit 0
+fi
+
+# Run clang-format.
+
+# Limit to 2gib (some files can use many gig's of memory).
+ulimit -Sv 2000000
+xargs clang-format -verbose -i <<< $FILES
diff --git a/clang-format-migration.sh b/clang-format-migration.sh
old mode 100644
new mode 100755



More information about the Bf-blender-cvs mailing list