Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename script #338

Merged
merged 4 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env sh

# usage: ./merge_plumelib.sh <clone_dir> <branch-1> <branch-2> <git_strategy> <merge_strategy>
# usage: ./merge_git_then_plumelib.sh <clone_dir> <branch-1> <branch-2> <git_strategy> <plumelib_strategy>

clone_dir=$1
branch1=$2
branch2=$3
git_strategy=$4 #"-Xignore-space-change"
merge_strategy=$5 #"--only-adjacent"
plumelib_strategy=$5 #"--only-adjacent"

## Perform merge

echo "$0: Merging $branch1 and $branch2 with git_strategy=$git_strategy and merge_strategy=$merge_strategy"
echo "$0: Merging $branch1 and $branch2 with git_strategy=$git_strategy and plumelib_strategy=$plumelib_strategy"

cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1)

Expand All @@ -20,15 +20,15 @@ git config --local merge.conflictstyle diff3
git config --local mergetool.prompt false
git config --local merge.tool merge-plumelib
# shellcheck disable=SC2016
git config --local mergetool.merge-plumelib.cmd 'java-merge-tool.sh '"$merge_strategy"' ${BASE} ${LOCAL} ${REMOTE} ${MERGED}'
git config --local mergetool.merge-plumelib.cmd 'java-merge-tool.sh '"$plumelib_strategy"' ${BASE} ${LOCAL} ${REMOTE} ${MERGED}'
git config --local mergetool.merge-plumelib.trustExitCode true

# shellcheck disable=SC2086
git merge --no-edit $git_strategy "$branch2"

## Now, run Plume-lib Merging to improve the result of `git merge`.

case "$merge_strategy" in
case "$plumelib_strategy" in
*"--no-imports"* | *"--only-adjacent"* | *"--only-annotations"* | *"--only-version-numbers"*)
# The "imports" merger is not being used, so don't use the "--all" command-line option.
all_arg=""
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort"
plumelib_strategy=""
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_adjacent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort"
plumelib_strategy="--only-adjacent"
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort -Xignore-space-change"
plumelib_strategy="--only-adjacent"
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_ignorespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort -Xignore-space-change"
plumelib_strategy=""
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort"
plumelib_strategy="--only-imports"
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort -Xignore-space-change"
plumelib_strategy="--only-imports"
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_version_number.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort"
plumelib_strategy="--only-version-numbers"
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branch1=$2
branch2=$3
git_strategy="-s ort -Xignore-space-change"
plumelib_strategy="--only-version-numbers"
"$MERGE_SCRIPTS_DIR"/merge_plumelib.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"