]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use common ancestor as base for formatting recent files 6942/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 21 Jul 2018 13:35:31 +0000 (15:35 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 21 Jul 2018 13:38:02 +0000 (15:38 +0200)
contrib/utilities/indent_common.sh

index 81cf5370f15194d60697e4c221cbad3f1f87a54d..f8169780c8675398d1bd520fa2509a582510d671 100644 (file)
@@ -235,6 +235,7 @@ process()
 process_changed()
 {
   LAST_MERGE_COMMIT="$(git log --format="%H" --merges --max-count=1 master)"
+  COMMON_ANCESTOR_WITH_MASTER="$(git merge-base ${LAST_MERGE_COMMIT} HEAD)"
 
   case "${OSTYPE}" in
     darwin*)
@@ -246,7 +247,7 @@ process_changed()
   esac
 
   ( git ls-files --others --exclude-standard -- ${1};
-    git diff --name-only $LAST_MERGE_COMMIT -- ${1} )|
+    git diff --name-only $COMMON_ANCESTOR_WITH_MASTER -- ${1} )|
       sort -u |
       grep -E "^${2}$" |
       ${XARGS} '\n' -n 1 -P 10 -I {} bash -c "${3} {}"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.