From 454846a93adb120b09c7aa9e30e58a5d69d0a721 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Mon, 2 Sep 2024 12:13:50 -0700 Subject: [PATCH] Check number of arguments --- src/scripts/merge_tools/git_hires_merge.sh | 7 +++++++ src/scripts/merge_tools/merge_git_then_plumelib.sh | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/scripts/merge_tools/git_hires_merge.sh b/src/scripts/merge_tools/git_hires_merge.sh index 71df96a76d..737f30c7cf 100755 --- a/src/scripts/merge_tools/git_hires_merge.sh +++ b/src/scripts/merge_tools/git_hires_merge.sh @@ -2,6 +2,13 @@ # usage: ./git_hires_merge.sh +set -o nounset + +if [ "$#" -ne 3 ]; then + echo "Usage: $0 CLONE_DIR BRANCH1 BRANCH2" >&2 + exit 1 +fi + clone_dir=$1 branch1=$2 branch2=$3 diff --git a/src/scripts/merge_tools/merge_git_then_plumelib.sh b/src/scripts/merge_tools/merge_git_then_plumelib.sh index 9c7c98289b..7d670b8ff9 100755 --- a/src/scripts/merge_tools/merge_git_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_git_then_plumelib.sh @@ -1,6 +1,17 @@ #!/usr/bin/env sh # usage: ./merge_git_then_plumelib.sh +# First runs `git merge`, then runs Plume-lib Merging to improve the result of `git merge`. +# must contain a clone of a repository. +# Return code is 0 for merge success, 1 for merge failure, 2 for script failure. +# For merge failure, also outputs "Conflict" and aborts the merge. + +set -o nounset + +if [ "$#" -ne 5 ]; then + echo "Usage: $0 CLONE_DIR BRANCH1 BRANCH2 GIT_STRATEGY PLUMELIB_STRATEGY" >&2 + exit 2 +fi clone_dir=$1 branch1=$2