diff --git a/src/scripts/merge_tools/gitmerge.sh b/src/scripts/merge_tools/gitmerge.sh index abcef148da..0949f1d409 100755 --- a/src/scripts/merge_tools/gitmerge.sh +++ b/src/scripts/merge_tools/gitmerge.sh @@ -1,23 +1,23 @@ #!/usr/bin/env sh -# usage: ./gitmerge.sh +# usage: ./gitmerge.sh # must contain a clone of a repository. -# is arguments to `git merge`, including -s and possibly -X. -# Merges branch2 into branch1, in , using merge strategy . +# is arguments to `git merge`, including -s and possibly -X. +# Merges branch2 into branch1, in , using merge strategy . # Return code is 0 for merge success, 1 for merge failure. # For merge failure, also outputs "Conflict" and aborts the merge. set -o nounset if [ "$#" -ne 4 ]; then - echo "Usage: $0 CLONE_DIR BRANCH1 BRANCH2 STRATEGY" >&2 + echo "Usage: $0 CLONE_DIR BRANCH1 BRANCH2 GIT_STRATEGY" >&2 exit 1 fi clone_dir=$1 branch1=$2 branch2=$3 -strategy=$4 +git_strategy=$4 ## Perform merge @@ -26,14 +26,14 @@ cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) git checkout "$branch1" --force git config merge.conflictstyle zdiff3 -echo "Running: git merge --no-edit $strategy $branch2" +echo "Running: git merge --no-edit $git_strategy $branch2" # shellcheck disable=SC2086 -git merge --no-edit $strategy "$branch2" +git merge --no-edit $git_strategy "$branch2" retVal=$? # report conflicts if [ $retVal -ne 0 ]; then - echo "gitmerge.sh: Conflict after running: git merge --no-edit $strategy $branch2" + echo "gitmerge.sh: Conflict after running: git merge --no-edit $git_strategy $branch2" fi exit $retVal diff --git a/src/scripts/merge_tools/gitmerge_ort.sh b/src/scripts/merge_tools/gitmerge_ort.sh index d8a695734b..2f74883e68 100755 --- a/src/scripts/merge_tools/gitmerge_ort.sh +++ b/src/scripts/merge_tools/gitmerge_ort.sh @@ -6,5 +6,5 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s ort" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s ort" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh b/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh index ef1a5df5f8..70b6ab3f80 100755 --- a/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh @@ -6,5 +6,5 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s ort -Xignore-space-change" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s ort -Xignore-space-change" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_recursive_histogram.sh b/src/scripts/merge_tools/gitmerge_recursive_histogram.sh index 6453c6e00e..e7a8677144 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_histogram.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_histogram.sh @@ -6,5 +6,5 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s recursive -Xdiff-algorithm=histogram" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s recursive -Xdiff-algorithm=histogram" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh b/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh index 812d2dcd18..ac78d10e16 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh @@ -6,5 +6,5 @@ MERGE_DIR="$(dirname "$0")" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s recursive -Xignore-space-change" -"$MERGE_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s recursive -Xignore-space-change" +"$MERGE_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_recursive_minimal.sh b/src/scripts/merge_tools/gitmerge_recursive_minimal.sh index e7d916539a..e1a4f4f4db 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_minimal.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_minimal.sh @@ -6,5 +6,5 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s recursive -Xdiff-algorithm=minimal" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s recursive -Xdiff-algorithm=minimal" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_recursive_myers.sh b/src/scripts/merge_tools/gitmerge_recursive_myers.sh index f95f093ba7..07c5c06328 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_myers.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_myers.sh @@ -6,5 +6,5 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s recursive -Xdiff-algorithm=myers" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s recursive -Xdiff-algorithm=myers" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_recursive_patience.sh b/src/scripts/merge_tools/gitmerge_recursive_patience.sh index 77e5a8e449..5a4e0782d8 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_patience.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_patience.sh @@ -6,5 +6,5 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s recursive -Xdiff-algorithm=patience" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s recursive -Xdiff-algorithm=patience" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" diff --git a/src/scripts/merge_tools/gitmerge_resolve.sh b/src/scripts/merge_tools/gitmerge_resolve.sh index 5c5965d0bc..c2485d076a 100755 --- a/src/scripts/merge_tools/gitmerge_resolve.sh +++ b/src/scripts/merge_tools/gitmerge_resolve.sh @@ -6,8 +6,8 @@ MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 -strategy="-s resolve" -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" +git_strategy="-s resolve" +"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$git_strategy" status=$? if [ "$status" -ne 0 ]; then