From: Daniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Date: Sat, 21 Jul 2018 13:35:31 +0000 (+0200)
Subject: Use common ancestor as base for formatting recent files
X-Git-Tag: v9.1.0-rc1~904^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7d049f670006602c2a8acdd480da93da461c6f6;p=dealii.git

Use common ancestor as base for formatting recent files
---

diff --git a/contrib/utilities/indent_common.sh b/contrib/utilities/indent_common.sh
index 81cf5370f1..f8169780c8 100644
--- a/contrib/utilities/indent_common.sh
+++ b/contrib/utilities/indent_common.sh
@@ -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} {}"