From 7a10de881dfcc3356e19489ad07842cdb6572234 Mon Sep 17 00:00:00 2001 From: Benedikt Schesch Date: Sun, 5 May 2024 23:16:47 -0700 Subject: [PATCH 1/2] Adde code --- src/scripts/merge_tools/resolve-blank-lines | 2 +- src/scripts/merge_tools/resolve-import-conflicts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/merge_tools/resolve-blank-lines b/src/scripts/merge_tools/resolve-blank-lines index 96656b9d7b..9e6141d075 100755 --- a/src/scripts/merge_tools/resolve-blank-lines +++ b/src/scripts/merge_tools/resolve-blank-lines @@ -24,7 +24,7 @@ # no option for ignoring blank lines. This script addresses that shortcoming. if [ "$#" -eq 0 ] ; then - readarray -t files < <(grep -l -r '^<<<<<<< HEAD' .) + files=($(grep -l -r '^<<<<<<< HEAD' .)) else files=("$@") fi diff --git a/src/scripts/merge_tools/resolve-import-conflicts b/src/scripts/merge_tools/resolve-import-conflicts index 73db46473d..38c6530afb 100755 --- a/src/scripts/merge_tools/resolve-import-conflicts +++ b/src/scripts/merge_tools/resolve-import-conflicts @@ -21,7 +21,7 @@ # in files, as the default git mergetool does. if [ "$#" -eq 0 ] ; then - readarray -t files < <(grep -l -r '^<<<<<<< HEAD' .) + files=($(grep -l -r '^<<<<<<< HEAD' .)) else files=("$@") fi From 0d7041d59fccc95ecb286d20b527db2f72fd54f5 Mon Sep 17 00:00:00 2001 From: Benedikt Schesch Date: Sun, 12 May 2024 17:57:02 -0700 Subject: [PATCH 2/2] Removed unused blank line script --- src/scripts/merge_tools/resolve-blank-lines | 42 --------------------- 1 file changed, 42 deletions(-) delete mode 100755 src/scripts/merge_tools/resolve-blank-lines diff --git a/src/scripts/merge_tools/resolve-blank-lines b/src/scripts/merge_tools/resolve-blank-lines deleted file mode 100755 index 9e6141d075..0000000000 --- a/src/scripts/merge_tools/resolve-blank-lines +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# bash, not POSIX sh, because of "readarray". - -# This script edits files in place to resolve conflict markers in which the -# differences are only in whitespace, including blank lines. This script -# leaves other conflict markers untouched. -# Usage: -# resolve-blank-lines [file ...] -# -# The script works on all files given on the command line. -# If none are given, the script works on all files in or under the current directory. -# -# The exit status code is 0 (success) if all conflicts are resolved. -# The exit status code is 1 (failure) if any conflict remains. -# -# This is not a git mergetool. A git mergetool is given the base, parent 1, and -# parent 2 files, all without conflict markers. -# However, this can be run after a git mergetool that leaves conflict markers -# in files, as the default git mergetool does. - -# Comparison to other tools -# -# `git diff` has a `--ignore-blank-lines` option, but `git merge` has -# no option for ignoring blank lines. This script addresses that shortcoming. - -if [ "$#" -eq 0 ] ; then - files=($(grep -l -r '^<<<<<<< HEAD' .)) -else - files=("$@") -fi - -SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)" - -status=0 - -for file in "${files[@]}" ; do - if ! "${SCRIPTDIR}"/resolve-conflicts.py --blank_lines "$file" ; then - status=1 - fi -done - -exit $status