From f7d049f670006602c2a8acdd480da93da461c6f6 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 21 Jul 2018 15:35:31 +0200 Subject: [PATCH] Use common ancestor as base for formatting recent files --- contrib/utilities/indent_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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} {}" -- 2.39.5