Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use absolute pathnames instead of depending on PATH #370

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/scripts/merge_tools/git_hires_merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ clone_dir=$1
branch1=$2
branch2=$3

SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)"

# Print the current PATH
echo "PATH: $PATH"
echo "$0 PATH: $PATH"

cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir from $(pwd)"; exit 2; }

Expand All @@ -25,7 +27,7 @@ attributes_file=".git/info/attributes"
echo "* merge=git-hires-merge" >> "$attributes_file"

git config --local merge.git-hires-merge.name "An interactive merge driver for resolving conflicts on individual or adjacent lines"
git config --local merge.git-hires-merge.driver "git-hires-merge %O %A %B %L %P"
git config --local merge.git-hires-merge.driver "${SCRIPTDIR}/git-hires-merge %O %A %B %L %P"
git config --local merge.git-hires-merge.recursive "binary"
git config --local merge.conflictstyle diff3

Expand Down
4 changes: 3 additions & 1 deletion src/scripts/merge_tools/merge_git_then_plumelib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ branch2=$3
git_strategy=$4 #"-Xignore-space-change"
plumelib_strategy=$5 #"--only-adjacent"

SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)"

VERBOSE=
## Enable for debugging
# VERBOSE=YES
Expand Down Expand Up @@ -55,7 +57,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 "$SCRIPTDIR"/'java-merge-tool.sh '"$plumelib_strategy"' ${BASE} ${LOCAL} ${REMOTE} ${MERGED}'
git config --local mergetool.merge-plumelib.trustExitCode true

case "$plumelib_strategy" in
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/merge_tools/merge_script_then_plumelib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ branch2=$3
merge_script=$4 #"-Xignore-space-change"
plumelib_strategy=$5 #"--only-adjacent"

SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)"

VERBOSE=
## Enable for debugging
# VERBOSE=YES
Expand Down Expand Up @@ -56,7 +58,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 "$SCRIPTDIR"/'java-merge-tool.sh '"$plumelib_strategy"' ${BASE} ${LOCAL} ${REMOTE} ${MERGED}'
git config --local mergetool.merge-plumelib.trustExitCode true

case "$plumelib_strategy" in
Expand Down