From e45c8d72c9edbda208ab2a9e889cd635157ae6a0 Mon Sep 17 00:00:00 2001 From: Benedikt Schesch Date: Thu, 25 Apr 2024 20:17:24 -0700 Subject: [PATCH] Fixed imports --- src/python/replay_merge.py | 6 +++--- src/scripts/merge_tools/gitmerge_ort_imports.sh | 14 ++++++++++++-- .../gitmerge_ort_imports_ignorespace.sh | 17 +++++++++++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/python/replay_merge.py b/src/python/replay_merge.py index 1aea302162..97180a6453 100755 --- a/src/python/replay_merge.py +++ b/src/python/replay_merge.py @@ -146,13 +146,13 @@ def merge_replay( "--merges_csv", help="CSV file with merges that have been tested", type=str, - default="results-small/result.csv", + default="results/small/result.csv", ) parser.add_argument( "--idx", help="Index of the merge to replay", - type=int, - default=0, + type=str, + default="0-1", ) parser.add_argument( "-test", diff --git a/src/scripts/merge_tools/gitmerge_ort_imports.sh b/src/scripts/merge_tools/gitmerge_ort_imports.sh index 6badfdb14b..eaa27a4947 100755 --- a/src/scripts/merge_tools/gitmerge_ort_imports.sh +++ b/src/scripts/merge_tools/gitmerge_ort_imports.sh @@ -12,9 +12,19 @@ export JAVA_HOME="$JAVA17_HOME" cd "$clone_dir" || exit 1 +git checkout "$branch1" --force + attributes_file=".git/info/attributes" echo "*.java merge=merge-java" >> "$attributes_file" - git config --local merge.merge-java.name "Merge Java files" git config --local merge.merge-java.driver 'java-merge-driver.sh "%A" "%O" "%B"' -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" + +git merge --no-edit $strategy "$branch2" +retVal=$? + +# report conflicts +if [ "$retVal" -ne 0 ]; then + echo "Conflict" +fi + +exit "$retVal" diff --git a/src/scripts/merge_tools/gitmerge_ort_imports_ignorespace.sh b/src/scripts/merge_tools/gitmerge_ort_imports_ignorespace.sh index 18b20a607c..189610051d 100755 --- a/src/scripts/merge_tools/gitmerge_ort_imports_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_ort_imports_ignorespace.sh @@ -1,8 +1,7 @@ #!/usr/bin/env sh -# usage: ./gitmerge_ort_imports_ignorespace.sh +# usage: ./git_hires_merge.sh -MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 branch1=$2 branch2=$3 @@ -12,9 +11,19 @@ export JAVA_HOME="$JAVA17_HOME" cd "$clone_dir" || exit 1 +git checkout "$branch1" --force + attributes_file=".git/info/attributes" echo "*.java merge=merge-java" >> "$attributes_file" - git config --local merge.merge-java.name "Merge Java files" git config --local merge.merge-java.driver 'java-merge-driver.sh "%A" "%O" "%B"' -"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" + +git merge --no-edit $strategy "$branch2" +retVal=$? + +# report conflicts +if [ "$retVal" -ne 0 ]; then + echo "Conflict" +fi + +exit "$retVal"