diff --git a/src/scripts/merge_tools/check-implementations.sh b/src/scripts/merge_tools/check-implementations.sh index 6266b17e3b..623a7f6d42 100755 --- a/src/scripts/merge_tools/check-implementations.sh +++ b/src/scripts/merge_tools/check-implementations.sh @@ -4,8 +4,12 @@ set -e +SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)" + # Check for identical content. +cd "$SCRIPTDIR" + diff -q ivn_plus.sh adjacent_plus.sh > /dev/null 2>&1 && { echo "identical: ivn_plus.sh adjacent_plus.sh"; exit 1; } diff -q ivn_plus.sh gitmerge_ort_plus.sh diff -q ivn_plus.sh imports_plus.sh @@ -26,25 +30,25 @@ tmpfile2=$(mktemp) for base in adjacent imports ivn version_numbers ; do diff "$base.sh" "${base}_ignorespace.sh" > "$tmpfile" || true - diff -q diff-pl-ignorespace.diff "$tmpfile" || { echo "problem with: diff $base.sh ${base}_ignorespace.sh" ; exit 1; } + diff -q diff-pl-ignorespace.diff "$tmpfile" || { echo "problem with: diff $base.sh ${base}_ignorespace.sh, expected to be as in diff-pl-ignorespace.diff" ; exit 1; } diff "${base}_plus.sh" "${base}_ignorespace_plus.sh" > "$tmpfile" || true - diff -q diff-pl-ignorespace.diff "$tmpfile" || { echo "problem with: diff ${base}_plus.sh ${base}_ignorespace_plus.sh" ; exit 1; } + diff -q diff-pl-ignorespace.diff "$tmpfile" || { echo "problem with: diff ${base}_plus.sh ${base}_ignorespace_plus.sh, expected to be as in diff-pl-ignorespace.diff" ; exit 1; } diff "$base.sh" "${base}_plus.sh" > "$tmpfile" || true diff "${base}_ignorespace.sh" "${base}_ignorespace_plus.sh" > "$tmpfile2" || true - diff -q "$tmpfile" "$tmpfile2" || { echo "problem with: ( $base.sh ${base}_plus.sh) versus ( ${base}_ignorespace.sh ${base}_ignorespace_plus.sh"; exit 1; } + diff -q "$tmpfile" "$tmpfile2" || { echo "problem with: ( $base.sh ${base}_plus .sh) versus ( ${base}_ignorespace.sh ${base}_ignorespace_plus.sh )"; exit 1; } done for base in gitmerge_ort gitmerge_recursive_myers ; do diff "$base.sh" "${base}_ignorespace.sh" > "$tmpfile" || true diff "${base}_plus.sh" "${base}_ignorespace_plus.sh" > "$tmpfile2" || true - diff -q "$tmpfile" "$tmpfile2" || { echo "problem with: ( $base.sh ${base}_ignorespace.sh) versus ( ${base}_plus.sh ${base}_ignorespace_plus.sh"; exit 1; } + diff -q "$tmpfile" "$tmpfile2" || { echo "problem with: ( $base.sh ${base}_ignorespace.sh ) versus ( ${base}_plus.sh ${base}_ignorespace_plus.sh )"; exit 1; } diff "$base.sh" "${base}_plus.sh" > "$tmpfile" || true diff "${base}_ignorespace.sh" "${base}_ignorespace_plus.sh" > "$tmpfile2" || true - diff -q "$tmpfile" "$tmpfile2" || { echo "problem with: ( $base.sh ${base}_plus.sh) versus ( ${base}_ignorespace.sh ${base}_ignorespace_plus.sh"; exit 1; } + diff -q "$tmpfile" "$tmpfile2" || { echo "problem with: ( $base.sh ${base}_plus.sh ) versus ( ${base}_ignorespace.sh ${base}_ignorespace_plus.sh )"; exit 1; } done @@ -56,7 +60,7 @@ for base in gitmerge_recursive_histogram gitmerge_recursive_minimal \ gitmerge_recursive_patience ; do diff "$base.sh" "${base}_plus.sh" > "$tmpfile" || true - diff -q diff-gm-plus.diff "$tmpfile" || { echo "problem with $base.sh ${base}_plus.sh"; exit 1; } + diff -q diff-gm-plus.diff "$tmpfile" || { echo "problem with $base.sh ${base}_plus.sh, expected to be as in diff-gm-plus.diff"; exit 1; } done diff --git a/src/scripts/merge_tools/diff-gm-plus.diff b/src/scripts/merge_tools/diff-gm-plus.diff index ad271b1ce4..7b877e6c50 100644 --- a/src/scripts/merge_tools/diff-gm-plus.diff +++ b/src/scripts/merge_tools/diff-gm-plus.diff @@ -1,5 +1,10 @@ -10c10,11 +6a7 +> verbose= +7a9 +> verbose="$1" +15c17,19 < "$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" --- > plumelib_strategy="" -> "$MERGE_SCRIPTS_DIR"/merge_git_then_plumelib.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" "$plumelib_strategy" +> # shellcheck disable=SC2086 # '$verbose' should not be quoted +> "$MERGE_SCRIPTS_DIR"/merge_git_then_plumelib.sh $verbose "$clone_dir" "$branch1" "$branch2" "$git_strategy" "$plumelib_strategy" diff --git a/src/scripts/merge_tools/diff-pl-ignorespace.diff b/src/scripts/merge_tools/diff-pl-ignorespace.diff index 87a9cfc3ee..92d4c15593 100644 --- a/src/scripts/merge_tools/diff-pl-ignorespace.diff +++ b/src/scripts/merge_tools/diff-pl-ignorespace.diff @@ -1,4 +1,4 @@ -9c9 +16c16 < git_strategy="-s ort" --- > git_strategy="-s ort -Xignore-space-change" diff --git a/src/scripts/merge_tools/gitmerge_ort.sh b/src/scripts/merge_tools/gitmerge_ort.sh index 22d3b7580e..b30f879b0a 100755 --- a/src/scripts/merge_tools/gitmerge_ort.sh +++ b/src/scripts/merge_tools/gitmerge_ort.sh @@ -4,7 +4,9 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" + if [ "$1" = "--verbose" ] ; then + shift fi diff --git a/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh b/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh index f836c0e836..f3f013c366 100755 --- a/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh @@ -4,7 +4,9 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" + if [ "$1" = "--verbose" ] ; then + shift fi diff --git a/src/scripts/merge_tools/gitmerge_recursive_myers.sh b/src/scripts/merge_tools/gitmerge_recursive_myers.sh index e34cf60558..865017930a 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_myers.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_myers.sh @@ -4,7 +4,9 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" + if [ "$1" = "--verbose" ] ; then + shift fi diff --git a/src/scripts/merge_tools/gitmerge_recursive_myers_ignorespace.sh b/src/scripts/merge_tools/gitmerge_recursive_myers_ignorespace.sh index 3e6e7f0107..6550919158 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_myers_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_myers_ignorespace.sh @@ -4,7 +4,9 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" + if [ "$1" = "--verbose" ] ; then + shift fi