Skip to content

Commit

Permalink
Reduce diffs (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Sep 5, 2024
1 parent ae9f644 commit 0fbf803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/gitmerge.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env sh

# usage: ./gitmerge.sh <clone_dir> <branch-1> <branch-2> <git_strategy>
# Merges branch2 into branch1, in <clone_dir>, using merge strategy <git_strategy>.
# <clone_dir> must contain a clone of a repository.
# <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, 2 for script failure.
# For merge failure, also outputs "Conflict" and aborts the merge.

Expand Down
10 changes: 5 additions & 5 deletions src/scripts/merge_tools/merge_git_then_plumelib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ echo "$0: Merging $branch1 and $branch2 with git_strategy=$git_strategy and plum
cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)

git checkout "$branch1" --force

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 '"$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`.

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.trustExitCode true

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.
Expand Down

0 comments on commit 0fbf803

Please sign in to comment.