From e4f1e5c3afb871e56a15d525f01ad356ef327b8f Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sun, 1 Sep 2024 19:27:46 -0700 Subject: [PATCH] Check number of arguments --- src/scripts/merge_tools/git_hires_merge.sh | 7 +++++++ src/scripts/merge_tools/merge_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 a91d69cda1..6d9116f7a7 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_plumelib.sh b/src/scripts/merge_tools/merge_plumelib.sh index 24dcebd971..4f209723c0 100755 --- a/src/scripts/merge_tools/merge_plumelib.sh +++ b/src/scripts/merge_tools/merge_plumelib.sh @@ -1,6 +1,17 @@ #!/usr/bin/env sh # usage: ./gitmerge_ort_imports_ignorespace.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