Skip to content

Commit

Permalink
Merge ../AST-Merging-Evaluation-branch-main into check-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Sep 2, 2024
2 parents b5d8e3e + bbd083b commit 36a2ff5
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/scripts/merge_tools/gitmerge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ git_strategy=$4
cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1)

git checkout "$branch1" --force
git config merge.conflictstyle zdiff3
git config --local merge.conflictstyle zdiff3
git config --local mergetool.prompt false

echo "Running: git merge --no-edit $git_strategy $branch2"
# shellcheck disable=SC2086
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/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>
# First runs `git merge`, then runs Plume-lib Merging to improve the result of `git merge`.
# <clone_dir> must contain a clone of a repository.
# Return code is 0 for merge success, 1 for merge failure, 2 for script failure.
Expand All @@ -17,11 +17,11 @@ 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 @@ -31,15 +31,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"

0 comments on commit 36a2ff5

Please sign in to comment.