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 e4f1e5c + 3f8a581 commit b5d8e3e
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions src/scripts/merge_tools/gitmerge.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/env sh

# usage: ./gitmerge.sh <clone_dir> <branch-1> <branch-2> <strategy>
# usage: ./gitmerge.sh <clone_dir> <branch-1> <branch-2> <git_strategy>
# <clone_dir> must contain a clone of a repository.
# <strategy> is arguments to `git merge`, including -s and possibly -X.
# Merges branch2 into branch1, in <clone_dir>, using merge strategy <strategy>.
# <git_strategy> is arguments to `git merge`, including -s and possibly -X.
# Merges branch2 into branch1, in <clone_dir>, using merge strategy <git_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

Expand All @@ -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
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_ort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_ort_ignorespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_recursive_histogram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_recursive_minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_recursive_myers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_recursive_patience.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions src/scripts/merge_tools/gitmerge_resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/merge_plumelib.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_imports_ignorespace.sh <clone_dir> <branch-1> <branch-2> <git_strategy> <merge_strategy>
# usage: ./merge_plumelib.sh <clone_dir> <branch-1> <branch-2> <git_strategy> <merge_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 Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_plumelib.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_adjacent.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_adjacent.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_adjacent.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_adjacent_ignorespace.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_adjacent_ignorespace.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_ignorespace.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_plumelib_ignorespace.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_ignorespace.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/plumelib_ort_imports.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_imports.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_imports.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_imports_ignorespace.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_imports_ignorespace.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
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
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_version_number.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_version_number.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# usage: ./gitmerge_ort_version_number_ignorespace.sh <clone_dir> <branch-1> <branch-2>
# usage: ./plumelib_ort_version_number_ignorespace.sh <clone_dir> <branch-1> <branch-2>

MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)"
clone_dir=$1
Expand Down

0 comments on commit b5d8e3e

Please sign in to comment.