diff --git a/ediff-merge-script b/ediff-merge-script index 3165912..646ccf1 100755 --- a/ediff-merge-script +++ b/ediff-merge-script @@ -41,7 +41,7 @@ _MKTEMP="/bin/mktemp" _LOCAL=${1} _REMOTE=${2} _MERGED=${3} -if [ -r "${4}" ] ; then +if [ -r "${4}" ]; then _BASE=${4} _EDIFF=ediff-merge-files-with-ancestor _EVAL="(${_EDIFF} \"${_LOCAL}\" \"${_REMOTE}\" \"${_BASE}\" nil \"${_MERGED}\")" diff --git a/git-clone-related b/git-clone-related index 3090719..df12905 100755 --- a/git-clone-related +++ b/git-clone-related @@ -43,14 +43,14 @@ # Fail if any command fails. set +e -if [ "$1" = "--debug" ] ; then +if [ "$1" = "--debug" ]; then DEBUG=1 shift set -x fi # FALLBACK_BRANCH may be unset. -if [ "$1" = "--upstream-branch" ] ; then +if [ "$1" = "--upstream-branch" ]; then shift FALLBACK_BRANCH=$1 shift @@ -82,7 +82,7 @@ if [ "$#" -eq 0 ]; then set -- -q --single-branch --depth 1 fi -if [ -n "$DEBUG" ] ; then +if [ -n "$DEBUG" ]; then echo "Entering git-clone-related $UPSTREAM_ORG $REPO_NAME $DESTINATION $*" fi @@ -101,21 +101,21 @@ else SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)" CI_INFO="$SCRIPTDIR/../plume-scripts/ci-info" - if [ ! -f "$CI_INFO" ] ; then + if [ ! -f "$CI_INFO" ]; then CI_INFO="$SCRIPTDIR/../.plume-scripts/ci-info" fi - if [ ! -f "$CI_INFO" ] ; then + if [ ! -f "$CI_INFO" ]; then CI_INFO="$SCRIPTDIR/.plume-scripts/ci-info" fi - if [ ! -f "$CI_INFO" ] ; then + if [ ! -f "$CI_INFO" ]; then (cd "$SCRIPTDIR" && git clone --depth 1 https://github.com/plume-lib/plume-scripts .plume-scripts) fi - if [ ! -f "$CI_INFO" ] ; then + if [ ! -f "$CI_INFO" ]; then echo "CI_INFO does not exist: $CI_INFO" exit 1 fi - if [ -n "$DEBUG" ] ; then + if [ -n "$DEBUG" ]; then echo "About to run ci-info --debug" "${CI_INFO}" --debug "${UPSTREAM_ORG}" echo "Ran ci-info --debug" @@ -123,27 +123,27 @@ else fi eval "$("${CI_INFO}" "${UPSTREAM_ORG}")" - if [ -n "$DEBUG" ] ; then + if [ -n "$DEBUG" ]; then echo "Finished running ci-info" fi UPSTREAM_REPO_URL="https://github.com/${UPSTREAM_ORG}/${REPO_NAME}.git" - if [ -n "$DEBUG" ] ; then + if [ -n "$DEBUG" ]; then echo "About to run git-find-fork" "${CI_ORGANIZATION}" "${UPSTREAM_ORG}" "${REPO_NAME}" fi # REPO_URL is what will be cloned. It might be the same as UPSTREAM_REPO_URL. REPO_URL=$("${SCRIPTDIR}"/git-find-fork "${CI_ORGANIZATION}" "${UPSTREAM_ORG}" "${REPO_NAME}") - if [ -n "$DEBUG" ] ; then + if [ -n "$DEBUG" ]; then echo "git-find-fork ${CI_ORGANIZATION} ${UPSTREAM_ORG} ${REPO_NAME} => ${REPO_URL}" fi - if [ -n "$DEBUG" ] ; then + if [ -n "$DEBUG" ]; then echo "About to run git-find-branch" "${REPO_URL}" "${CI_BRANCH_NAME}" ${FALLBACK_BRANCH:+"$FALLBACK_BRANCH"} fi REPO_BRANCH=$("${SCRIPTDIR}"/git-find-branch "${REPO_URL}" "${CI_BRANCH_NAME}" ${FALLBACK_BRANCH:+"$FALLBACK_BRANCH"}) - if [ -n "$DEBUG" ] ; then + if [ -n "$DEBUG" ]; then echo "git-find-branch ${REPO_URL} ${CI_BRANCH_NAME} => ${REPO_BRANCH}" fi - if [ "$UPSTREAM_REPO_URL" != "$REPO_URL" ] && [ "$REPO_BRANCH" != "$CI_BRANCH_NAME" ] ; then + if [ "$UPSTREAM_REPO_URL" != "$REPO_URL" ] && [ "$REPO_BRANCH" != "$CI_BRANCH_NAME" ]; then ## Don't use the fallback branch (e.g., master) of the downstream repo REPO_URL="$UPSTREAM_REPO_URL" REPO_BRANCH=$("${SCRIPTDIR}"/git-find-branch "${REPO_URL}" "${CI_BRANCH_NAME}" ${FALLBACK_BRANCH:+"$FALLBACK_BRANCH"}) diff --git a/resolve-adjacent-conflicts b/resolve-adjacent-conflicts index cf73382..efb2fac 100755 --- a/resolve-adjacent-conflicts +++ b/resolve-adjacent-conflicts @@ -38,7 +38,7 @@ echo "which is an obsolete version in https://github.com/plume-lib/git-scripts . DEBUG=0 -if [ "$#" -eq 0 ] ; then +if [ "$#" -eq 0 ]; then readarray -t files < <(grep -l -r '^<<<<<<< HEAD' .) else files=("$@") @@ -49,14 +49,14 @@ SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)" status=0 for file in "${files[@]}" ; do - if [ "$DEBUG" ] ; then + if [ "$DEBUG" ]; then echo "before resolve-conflicts.py: $(sha256sum "$file")" cat "$file" fi if ! "${SCRIPTDIR}"/resolve-conflicts.py --adjacent_lines "$file" ; then status=1 fi - if [ "$DEBUG" ] ; then + if [ "$DEBUG" ]; then echo "after resolve-conflicts.py: (status=$status: $(sha256sum "$file")" cat "$file" fi diff --git a/resolve-blank-lines b/resolve-blank-lines index 96656b9..2e6924c 100755 --- a/resolve-blank-lines +++ b/resolve-blank-lines @@ -23,7 +23,7 @@ # `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 +if [ "$#" -eq 0 ]; then readarray -t files < <(grep -l -r '^<<<<<<< HEAD' .) else files=("$@") diff --git a/resolve-import-conflicts b/resolve-import-conflicts index 635e3fe..97b56fe 100755 --- a/resolve-import-conflicts +++ b/resolve-import-conflicts @@ -24,7 +24,7 @@ echo "which is an obsolete version in https://github.com/plume-lib/git-scripts . # However, this can be run after a git mergetool that leaves conflict markers # in files, as the default git mergetool does. -if [ "$#" -eq 0 ] ; then +if [ "$#" -eq 0 ]; then readarray -t files < <(grep -l -r '^<<<<<<< HEAD' .) else files=("$@") diff --git a/tests/git-clone-related-test/test-git-clone-related.sh b/tests/git-clone-related-test/test-git-clone-related.sh index 8757b55..f5962de 100755 --- a/tests/git-clone-related-test/test-git-clone-related.sh +++ b/tests/git-clone-related-test/test-git-clone-related.sh @@ -43,12 +43,12 @@ clonedbranch=$(git -C "$goaldir" rev-parse --abbrev-ref HEAD) rm -rf "$startdir" "$goaldir" -if [ "$clonedrepo" != "$GOAL_REPO" ] ; then +if [ "$clonedrepo" != "$GOAL_REPO" ]; then echo "test-git-clone-related.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\"" echo "expected repo $GOAL_REPO, got: $clonedrepo" exit 2 fi -if [ "$clonedbranch" != "$GOAL_BRANCH" ] ; then +if [ "$clonedbranch" != "$GOAL_BRANCH" ]; then echo "test-git-clone-related.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\"" echo "expected branch $GOAL_BRANCH, got: $clonedbranch" exit 2