From 2635b2a26d436d6f32f18ece6fd1610b0159b53c Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 12:24:10 -0700 Subject: [PATCH 1/9] Quieter compilation (#364) --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index b2aba3efb8..09d18cb605 100755 --- a/run.sh +++ b/run.sh @@ -129,7 +129,7 @@ fi cd ./src/scripts/merge_tools/merging export JAVA_HOME=$GRAALVM_HOME export PATH="$JAVA_HOME/bin:$PATH" - ./gradlew nativeCompile + ./gradlew -q nativeCompile ) echo "Machine ID: $machine_id" From 6be4a1f218337f31e89e8aad27c30f3bd8fabefa Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 12:24:21 -0700 Subject: [PATCH 2/9] Add diagnostics (#367) --- src/scripts/merge_tools/gitmerge.sh | 18 ++++++++++- .../merge_tools/merge_git_then_plumelib.sh | 32 +++++++++++++++++++ .../merge_tools/merge_script_then_plumelib.sh | 32 +++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/scripts/merge_tools/gitmerge.sh b/src/scripts/merge_tools/gitmerge.sh index ce27cc1161..bf373243f9 100755 --- a/src/scripts/merge_tools/gitmerge.sh +++ b/src/scripts/merge_tools/gitmerge.sh @@ -19,19 +19,35 @@ branch1=$2 branch2=$3 git_strategy=$4 +VERBOSE= +## Enable for debugging +# VERBOSE=YES + + ## Perform merge cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; } +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git checkout $branch1 in $(pwd)" +fi git checkout "$branch1" --force +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git checkout $branch1 in $(pwd)" +fi git config --local merge.conflictstyle diff3 git config --local mergetool.prompt false -echo "Running: git merge --no-edit $git_strategy $branch2" +echo "$0: about to run: git merge --no-edit $git_strategy $branch2 in $(pwd)" + # shellcheck disable=SC2086 git merge --no-edit $git_strategy "$branch2" retVal=$? +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git merge --no-edit $git_strategy $branch2 in $(pwd)" +fi + # report conflicts if [ $retVal -ne 0 ]; then echo "gitmerge.sh: Conflict after running: git merge --no-edit $git_strategy $branch2" diff --git a/src/scripts/merge_tools/merge_git_then_plumelib.sh b/src/scripts/merge_tools/merge_git_then_plumelib.sh index c06a827be3..329997dad3 100755 --- a/src/scripts/merge_tools/merge_git_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_git_then_plumelib.sh @@ -19,19 +19,38 @@ branch2=$3 git_strategy=$4 #"-Xignore-space-change" plumelib_strategy=$5 #"--only-adjacent" +VERBOSE= +## Enable for debugging +# VERBOSE=YES + + ## Perform merge 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 2; } +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git checkout $branch1 in $(pwd)" +fi git checkout "$branch1" --force +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git checkout $branch1 in $(pwd)" +fi git config --local merge.conflictstyle diff3 git config --local mergetool.prompt false +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git merge --no-edit $git_strategy $branch2 in $(pwd)" +fi + # shellcheck disable=SC2086 git merge --no-edit $git_strategy "$branch2" +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git merge --no-edit $git_strategy $branch2 in $(pwd)" +fi + ## Now, run Plume-lib Merging to improve the result of `git merge`. git config --local merge.tool merge-plumelib @@ -50,15 +69,28 @@ case "$plumelib_strategy" in ;; esac +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" +fi git-mergetool.sh $all_arg --tool=merge-plumelib +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" +fi # Check if there are still conflicts diffs=$(git diff --name-only --diff-filter=U) if [ -z "$diffs" ]; then git add . + if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git commit in $(pwd)" + fi git commit -m "Resolved conflicts by calling: git-mergetool.sh $all_arg --tool=merge-plumelib" + if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git commit in $(pwd)" + fi exit 0 fi +echo "$0: exiting with status 1" echo "$0: diffs=$diffs" echo "$0: Conflict after running in $(pwd):" echo " git merge --no-edit $git_strategy $branch2" diff --git a/src/scripts/merge_tools/merge_script_then_plumelib.sh b/src/scripts/merge_tools/merge_script_then_plumelib.sh index f2fa314512..0c03e8f22f 100755 --- a/src/scripts/merge_tools/merge_script_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_script_then_plumelib.sh @@ -20,19 +20,38 @@ branch2=$3 merge_script=$4 #"-Xignore-space-change" plumelib_strategy=$5 #"--only-adjacent" +VERBOSE= +## Enable for debugging +# VERBOSE=YES + + ## Perform merge echo "$0: Merging $branch1 and $branch2 with merge_script=$merge_script and plumelib_strategy=$plumelib_strategy" cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; } +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git checkout $branch1 in $(pwd)" +fi git checkout "$branch1" --force +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git checkout $branch1 in $(pwd)" +fi git config --local merge.conflictstyle diff3 git config --local mergetool.prompt false +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: $merge_script $clone_dir $branch1 $branch2 in $(pwd)" +fi + # shellcheck disable=SC2086 $merge_script "$clone_dir" "$branch1" "$branch2" +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: $merge_script $clone_dir $branch1 $branch2 in $(pwd)" +fi + ## Now, run Plume-lib Merging to improve the result of `$merge_script`. git config --local merge.tool merge-plumelib @@ -51,15 +70,28 @@ case "$plumelib_strategy" in ;; esac +if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" +fi git-mergetool.sh $all_arg --tool=merge-plumelib +if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" +fi # Check if there are still conflicts diffs=$(git diff --name-only --diff-filter=U) if [ -z "$diffs" ]; then git add . + if [ -n "$VERBOSE" ] ; then + echo "$0: about to run: git commit in $(pwd)" + fi git commit -m "Resolved conflicts by calling: git-mergetool.sh $all_arg --tool=merge-plumelib" + if [ -n "$VERBOSE" ] ; then + echo "$0: ran: git commit in $(pwd)" + fi exit 0 fi +echo "$0: exiting with status 1" echo "$0: diffs=$diffs" echo "$0: Conflict after running in $(pwd):" echo " $merge_script $clone_dir $branch1 $branch2" From 0ce02a56a6977d89e48e1d4e33acc0512a804733 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 12:24:33 -0700 Subject: [PATCH 3/9] Improve diagnostics (#365) --- src/python/replay_merge.py | 11 ++++++----- src/python/repo.py | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/python/replay_merge.py b/src/python/replay_merge.py index 321472e87e..27991cbd16 100755 --- a/src/python/replay_merge.py +++ b/src/python/replay_merge.py @@ -268,11 +268,11 @@ def merge_replay( stderr=subprocess.PIPE, ) if len(process.stderr.decode("utf-8")) == 0: - conflict_files = process.stdout.decode("utf-8") - is_conflict = len(conflict_files) > 0 + git_conflict_files = process.stdout.decode("utf-8") + is_conflict = len(git_conflict_files) > 0 assert ( is_conflict == (merge_result == MERGE_STATE.Merge_failed) - ), f"merge_replay: tool{merge_tool} merge_result {merge_result} does not match conflict_files {conflict_files} at path {repo.local_repo_path}" + ), f"merge_replay: tool merge result is inconsistent with `git diff --diff-filter=U`: tool={merge_tool} merge_result={merge_result} git_conflict_files={git_conflict_files} path={repo.local_repo_path}" result_df.loc[ merge_tool.name, @@ -308,10 +308,11 @@ def merge_replay( store_artifacts(result_df) if delete_workdir: delete_workdirs(result_df) - print("=====================================\n") + print("fingerprints differ; details follow.") + print(f"=================== start of {log_path}:") with open(log_path, "r", encoding="utf-8") as f: print(f.read()) - print("=====================================\n") + print(f"=================== end of {log_path}.") raise Exception( f"fingerprints differ: after merge of {workdir} with {merge_tool}, found" + f" {merge_fingerprint} but expected " diff --git a/src/python/repo.py b/src/python/repo.py index 1289b28223..023a293085 100755 --- a/src/python/repo.py +++ b/src/python/repo.py @@ -152,11 +152,20 @@ def stdout_and_stderr( source: Union[subprocess.TimeoutExpired, subprocess.CompletedProcess], ) -> str: """Produces the standard output and standard error of a timedout process.""" - explanation = "Run Command: " + " ".join(command) + "\nTimed out" + explanation = "Here is the output from: " + " ".join(command) if source.stdout: - explanation += "\nstdout:\n" + source.stdout.decode("utf-8", "replace") + explanation += ( + "\nstdout:\n" + + source.stdout.decode("utf-8", "replace") + + "\nEnd of stdout." + ) if source.stderr: - explanation += "\nstderr:\n" + source.stderr.decode("utf-8", "replace") + explanation += ( + "\nstderr:\n" + + source.stderr.decode("utf-8", "replace") + + "\nEnd of stderr." + ) + explanation += "\nEnd of output from: " + " ".join(command) return explanation From 26bb427ab531b13bd226ecb357f9442d5c388e11 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 12:24:52 -0700 Subject: [PATCH 4/9] Sort file names (#361) --- src/scripts/merge_tools/merge_git_then_plumelib.sh | 2 +- src/scripts/merge_tools/merge_script_then_plumelib.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/merge_tools/merge_git_then_plumelib.sh b/src/scripts/merge_tools/merge_git_then_plumelib.sh index 329997dad3..08d219d1c1 100755 --- a/src/scripts/merge_tools/merge_git_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_git_then_plumelib.sh @@ -78,7 +78,7 @@ if [ -n "$VERBOSE" ] ; then fi # Check if there are still conflicts -diffs=$(git diff --name-only --diff-filter=U) +diffs=$(git diff --name-only --diff-filter=U | sort) if [ -z "$diffs" ]; then git add . if [ -n "$VERBOSE" ] ; then diff --git a/src/scripts/merge_tools/merge_script_then_plumelib.sh b/src/scripts/merge_tools/merge_script_then_plumelib.sh index 0c03e8f22f..d42af44d31 100755 --- a/src/scripts/merge_tools/merge_script_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_script_then_plumelib.sh @@ -79,7 +79,7 @@ if [ -n "$VERBOSE" ] ; then fi # Check if there are still conflicts -diffs=$(git diff --name-only --diff-filter=U) +diffs=$(git diff --name-only --diff-filter=U | sort) if [ -z "$diffs" ]; then git add . if [ -n "$VERBOSE" ] ; then From e4f388f5b2e3397dfb5cdb5d57d904013350cfc8 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 12:30:07 -0700 Subject: [PATCH 5/9] Rename variable (#363) Co-authored-by: Benedikt Schesch <37979523+benedikt-schesch@users.noreply.github.com> --- src/scripts/merge_tools/intellimerge.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/merge_tools/intellimerge.sh b/src/scripts/merge_tools/intellimerge.sh index 3ddd822427..44da521634 100755 --- a/src/scripts/merge_tools/intellimerge.sh +++ b/src/scripts/merge_tools/intellimerge.sh @@ -44,13 +44,13 @@ git checkout "$branch1" --force git merge --no-edit "$branch2" # List conflicitng files -conflict_files=$(git diff --name-only --diff-filter=U) +git_conflict_files=$(git diff --name-only --diff-filter=U) # Initialize a flag to track conflict resolution conflicts_resolved=true # Iterate through conflicting files -for file in $conflict_files; do +for file in $git_conflict_files; do # Check if the conflicting file exists in the temp_out_dir if [ ! -f "$temp_out_dir$file" ]; then echo "Conflict not resolved for file: $file" @@ -62,7 +62,7 @@ done if [ "$conflicts_resolved" = false ]; then echo "Conflict detected. Aborting the merge. Please resolve the conflicts." echo "All conflicting files:" - echo "$conflict_files" + echo "$git_conflict_files" rm -rf $temp_out_dir $temp_intellimerge_dir exit 1 fi From cd2cfe8ff68091804a7a4ced9254f617b8840a40 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 16:27:56 -0700 Subject: [PATCH 6/9] Reduce diffs between script implementations --- README.md | 10 ++++++++++ src/scripts/merge_tools/adjacent.sh | 2 +- src/scripts/merge_tools/adjacent_ignorespace.sh | 2 +- src/scripts/merge_tools/adjacent_plus.sh | 2 +- src/scripts/merge_tools/git_hires_merge.sh | 2 +- src/scripts/merge_tools/git_hires_merge_plus.sh | 2 +- src/scripts/merge_tools/gitmerge_ort.sh | 2 +- src/scripts/merge_tools/gitmerge_ort_ignorespace.sh | 2 +- .../merge_tools/gitmerge_recursive_histogram.sh | 2 +- .../merge_tools/gitmerge_recursive_histogram_plus.sh | 2 +- .../merge_tools/gitmerge_recursive_ignorespace.sh | 2 +- .../merge_tools/gitmerge_recursive_ignorespace_plus.sh | 2 +- src/scripts/merge_tools/gitmerge_recursive_minimal.sh | 2 +- .../merge_tools/gitmerge_recursive_minimal_plus.sh | 2 +- src/scripts/merge_tools/gitmerge_recursive_myers.sh | 2 +- .../merge_tools/gitmerge_recursive_myers_plus.sh | 2 +- src/scripts/merge_tools/gitmerge_recursive_patience.sh | 2 +- .../merge_tools/gitmerge_recursive_patience_plus.sh | 2 +- src/scripts/merge_tools/gitmerge_resolve.sh | 2 +- src/scripts/merge_tools/gitmerge_resolve_plus.sh | 2 +- src/scripts/merge_tools/imports.sh | 2 +- src/scripts/merge_tools/imports_ignorespace.sh | 2 +- src/scripts/merge_tools/intellimerge.sh | 2 +- src/scripts/merge_tools/intellimerge_plus.sh | 2 +- src/scripts/merge_tools/ivn.sh | 2 +- src/scripts/merge_tools/ivn_ignorespace.sh | 2 +- src/scripts/merge_tools/spork.sh | 2 +- src/scripts/merge_tools/spork_plus.sh | 2 +- src/scripts/merge_tools/version_numbers.sh | 2 +- src/scripts/merge_tools/version_numbers_ignorespace.sh | 2 +- 30 files changed, 39 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f7887f805e..01415643a4 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,14 @@ If `make small-test` fails in a branch that you wish to merge into the main branch, run `make small-test` in the main branch (which should succeed) and also in your branch, and investigate the differences. +#### Updating the goal files + +If you make a change to the mergers that changes merge results, you need to +update the goal files or else reproducibility checks will fail. +Copy certain files from `results/small/` to `test/small-goal-files/`. + +To update the reproducibility tests, run `make run-all`. + ### Load the stored cache To decompress the cache run `make decompress-cache`. This is done automatically in `run_combined.sh` if `cache/` does not exist. @@ -238,6 +246,8 @@ To investigate differences between two mergers: * Set `DELETE_WORKDIRS` to `false` in `src/python/variables.py`. * run `src/python/replay_merge.py --idx INDEX` (maybe add `-test`) for the index of the merge you are interested in. +If the merge is in the small test, you may need to add `--merges_csv ./test/small-goal-files/result.csv`. + ## Overwriting results manually In some cases it might be worth to overwrite the computed results. To do that you should modify the `results/manual_override.csv` file. In that file for the merge you want to overwrite a result of you should include at least the information `repository,merge,left,right` and a new column for the result you want to overwrite. You can overwrite anything you want but if there is a column you don't want to overwrite either do not include that column or leave the entry blanck i.e. `,,`. See the file for an example. diff --git a/src/scripts/merge_tools/adjacent.sh b/src/scripts/merge_tools/adjacent.sh index a66d6eff43..116661bb3b 100755 --- a/src/scripts/merge_tools/adjacent.sh +++ b/src/scripts/merge_tools/adjacent.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./adjacent.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/adjacent_ignorespace.sh b/src/scripts/merge_tools/adjacent_ignorespace.sh index 0baf960fc1..947334cc5c 100755 --- a/src/scripts/merge_tools/adjacent_ignorespace.sh +++ b/src/scripts/merge_tools/adjacent_ignorespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./adjacent_ignorespace.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/adjacent_plus.sh b/src/scripts/merge_tools/adjacent_plus.sh index adb0478df2..f246994a9d 100755 --- a/src/scripts/merge_tools/adjacent_plus.sh +++ b/src/scripts/merge_tools/adjacent_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./adjacent.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/git_hires_merge.sh b/src/scripts/merge_tools/git_hires_merge.sh index ef1795eb9c..83d2fad295 100755 --- a/src/scripts/merge_tools/git_hires_merge.sh +++ b/src/scripts/merge_tools/git_hires_merge.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./git_hires_merge.sh +# usage: set -o nounset diff --git a/src/scripts/merge_tools/git_hires_merge_plus.sh b/src/scripts/merge_tools/git_hires_merge_plus.sh index 38f01be17a..ed8ed5b86d 100755 --- a/src/scripts/merge_tools/git_hires_merge_plus.sh +++ b/src/scripts/merge_tools/git_hires_merge_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./git_hires_merge_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_ort.sh b/src/scripts/merge_tools/gitmerge_ort.sh index 2f74883e68..8d736ef802 100755 --- a/src/scripts/merge_tools/gitmerge_ort.sh +++ b/src/scripts/merge_tools/gitmerge_ort.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_ort.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh b/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh index 70b6ab3f80..5b58d1679c 100755 --- a/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_ort_ignorespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_ort_ignorespace.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_histogram.sh b/src/scripts/merge_tools/gitmerge_recursive_histogram.sh index e7a8677144..2d6acab8d5 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_histogram.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_histogram.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_histogram.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_histogram_plus.sh b/src/scripts/merge_tools/gitmerge_recursive_histogram_plus.sh index 0ecfb0d6b3..aaf9c13609 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_histogram_plus.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_histogram_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_histogram_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh b/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh index ac78d10e16..1d735e8362 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_ignorespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_ignorespace.sh +# usage: MERGE_DIR="$(dirname "$0")" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_ignorespace_plus.sh b/src/scripts/merge_tools/gitmerge_recursive_ignorespace_plus.sh index a49b82bc12..e9bdd0e77f 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_ignorespace_plus.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_ignorespace_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_ignorespace_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_minimal.sh b/src/scripts/merge_tools/gitmerge_recursive_minimal.sh index e1a4f4f4db..6efc432059 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_minimal.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_minimal.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_minimal.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_minimal_plus.sh b/src/scripts/merge_tools/gitmerge_recursive_minimal_plus.sh index f9457f945d..c8151126c6 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_minimal_plus.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_minimal_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_minimal_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_myers.sh b/src/scripts/merge_tools/gitmerge_recursive_myers.sh index 07c5c06328..dd0c432487 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_myers.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_myers.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_myers.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_myers_plus.sh b/src/scripts/merge_tools/gitmerge_recursive_myers_plus.sh index 712c3c0c76..dea5c5dac0 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_myers_plus.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_myers_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_myers_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_patience.sh b/src/scripts/merge_tools/gitmerge_recursive_patience.sh index 5a4e0782d8..f5fe3f76ee 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_patience.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_patience.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_patience.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_recursive_patience_plus.sh b/src/scripts/merge_tools/gitmerge_recursive_patience_plus.sh index de31d1d26c..51b28505b2 100755 --- a/src/scripts/merge_tools/gitmerge_recursive_patience_plus.sh +++ b/src/scripts/merge_tools/gitmerge_recursive_patience_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_recursive_patience_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_resolve.sh b/src/scripts/merge_tools/gitmerge_resolve.sh index 3287584a16..56bf5db8d9 100755 --- a/src/scripts/merge_tools/gitmerge_resolve.sh +++ b/src/scripts/merge_tools/gitmerge_resolve.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# usage: ./gitmerge_resolve.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/gitmerge_resolve_plus.sh b/src/scripts/merge_tools/gitmerge_resolve_plus.sh index f910795811..e78198a189 100755 --- a/src/scripts/merge_tools/gitmerge_resolve_plus.sh +++ b/src/scripts/merge_tools/gitmerge_resolve_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./gitmerge_resolve_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/imports.sh b/src/scripts/merge_tools/imports.sh index 74808cffac..4850621e23 100755 --- a/src/scripts/merge_tools/imports.sh +++ b/src/scripts/merge_tools/imports.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./imports.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/imports_ignorespace.sh b/src/scripts/merge_tools/imports_ignorespace.sh index 5ab81c26b4..c263ca4829 100755 --- a/src/scripts/merge_tools/imports_ignorespace.sh +++ b/src/scripts/merge_tools/imports_ignorespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./imports_ignorespace.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/intellimerge.sh b/src/scripts/merge_tools/intellimerge.sh index 44da521634..5641d4f16a 100755 --- a/src/scripts/merge_tools/intellimerge.sh +++ b/src/scripts/merge_tools/intellimerge.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./intellimerge.sh +# usage: # must contain a clone of a repository. # Merges branch2 into branch1, in . # Return code is 0 for merge success, 1 for merge failure, 2 for script failure. diff --git a/src/scripts/merge_tools/intellimerge_plus.sh b/src/scripts/merge_tools/intellimerge_plus.sh index bccff7d4fd..044e290166 100755 --- a/src/scripts/merge_tools/intellimerge_plus.sh +++ b/src/scripts/merge_tools/intellimerge_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./intellimerge_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/ivn.sh b/src/scripts/merge_tools/ivn.sh index 162976a74f..15a395c7a0 100755 --- a/src/scripts/merge_tools/ivn.sh +++ b/src/scripts/merge_tools/ivn.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./ivn.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/ivn_ignorespace.sh b/src/scripts/merge_tools/ivn_ignorespace.sh index e6d4d5aa31..af3a3009f4 100755 --- a/src/scripts/merge_tools/ivn_ignorespace.sh +++ b/src/scripts/merge_tools/ivn_ignorespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./ivn_ignorespace.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/spork.sh b/src/scripts/merge_tools/spork.sh index 595cee1473..fcc7386d24 100755 --- a/src/scripts/merge_tools/spork.sh +++ b/src/scripts/merge_tools/spork.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./spork.sh +# usage: # must contain a clone of a repository. # Merges branch2 into branch1, in . # Return code is 0 for merge success, 1 for merge failure, 2 for script failure. diff --git a/src/scripts/merge_tools/spork_plus.sh b/src/scripts/merge_tools/spork_plus.sh index 44f67a1046..12633ade4f 100755 --- a/src/scripts/merge_tools/spork_plus.sh +++ b/src/scripts/merge_tools/spork_plus.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./spork_plus.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/version_numbers.sh b/src/scripts/merge_tools/version_numbers.sh index 9eb28511a9..1166b146cd 100755 --- a/src/scripts/merge_tools/version_numbers.sh +++ b/src/scripts/merge_tools/version_numbers.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./version_numbers.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 diff --git a/src/scripts/merge_tools/version_numbers_ignorespace.sh b/src/scripts/merge_tools/version_numbers_ignorespace.sh index c902f8e03a..9fca1f26ed 100755 --- a/src/scripts/merge_tools/version_numbers_ignorespace.sh +++ b/src/scripts/merge_tools/version_numbers_ignorespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# usage: ./version_numbers_ignorespace.sh +# usage: MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" clone_dir=$1 From 0f84f1782a4749ec9369d3862ea6a640e9ece64f Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 18:21:37 -0700 Subject: [PATCH 7/9] Correct order of arguments --- src/scripts/merge_tools/merge_git_then_plumelib.sh | 2 +- src/scripts/merge_tools/merge_script_then_plumelib.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/merge_tools/merge_git_then_plumelib.sh b/src/scripts/merge_tools/merge_git_then_plumelib.sh index 08d219d1c1..bca7837ed6 100755 --- a/src/scripts/merge_tools/merge_git_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_git_then_plumelib.sh @@ -55,7 +55,7 @@ fi git config --local merge.tool merge-plumelib # shellcheck disable=SC2016 -git config --local mergetool.merge-plumelib.cmd 'java-merge-tool.sh '"$plumelib_strategy"' ${BASE} ${LOCAL} ${REMOTE} ${MERGED}' +git config --local mergetool.merge-plumelib.cmd 'java-merge-tool.sh '"$plumelib_strategy"' ${LOCAL} ${BASE} ${REMOTE} ${MERGED}' git config --local mergetool.merge-plumelib.trustExitCode true case "$plumelib_strategy" in diff --git a/src/scripts/merge_tools/merge_script_then_plumelib.sh b/src/scripts/merge_tools/merge_script_then_plumelib.sh index d42af44d31..d82507a3ef 100755 --- a/src/scripts/merge_tools/merge_script_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_script_then_plumelib.sh @@ -56,7 +56,7 @@ fi git config --local merge.tool merge-plumelib # shellcheck disable=SC2016 -git config --local mergetool.merge-plumelib.cmd 'java-merge-tool.sh '"$plumelib_strategy"' ${BASE} ${LOCAL} ${REMOTE} ${MERGED}' +git config --local mergetool.merge-plumelib.cmd 'java-merge-tool.sh '"$plumelib_strategy"' ${LOCAL} ${BASE} ${REMOTE} ${MERGED}' git config --local mergetool.merge-plumelib.trustExitCode true case "$plumelib_strategy" in From 1055d437af794edd34cba44e33915000cb2dbb23 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 18:52:09 -0700 Subject: [PATCH 8/9] Don't use verbose by default --- src/scripts/merge_tools/merging | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/merge_tools/merging b/src/scripts/merge_tools/merging index 694e1ac7bd..dfa28f8954 160000 --- a/src/scripts/merge_tools/merging +++ b/src/scripts/merge_tools/merging @@ -1 +1 @@ -Subproject commit 694e1ac7bdb17a2631442405513e748c837a9f3b +Subproject commit dfa28f8954956fb952805cc1fb628287475a855a From 324858fe5bd6034bc44dc87d8848d213bf71ca4f Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 21 Sep 2024 19:35:00 -0700 Subject: [PATCH 9/9] Remove output to standard error --- src/scripts/merge_tools/merge_git_then_plumelib.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/scripts/merge_tools/merge_git_then_plumelib.sh b/src/scripts/merge_tools/merge_git_then_plumelib.sh index 11e3bd5a8b..62d8561d99 100755 --- a/src/scripts/merge_tools/merge_git_then_plumelib.sh +++ b/src/scripts/merge_tools/merge_git_then_plumelib.sh @@ -75,10 +75,8 @@ esac if [ -n "$VERBOSE" ] ; then echo "$0: about to run: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" - echo "$0: about to run: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" >&2 git-mergetool.sh --verbose $all_arg --tool=merge-plumelib echo "$0: ran: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" - echo "$0: ran: git-mergetool.sh $all_arg --tool=merge-plumelib in $(pwd)" >&2 else git-mergetool.sh $all_arg --tool=merge-plumelib fi