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

YETUS-1222. smart-apply-patch EXTRA_ARGS should be an array #303

Merged
merged 1 commit into from
May 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions precommit/src/main/shell/smart-apply-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BINDIR=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd -P)
QATESTMODE=false
STARTINGDIR=$(pwd)


# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -39,6 +39,7 @@ function add_vote_table_v2
true
}

# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -48,6 +49,7 @@ function add_footer_table
true
}

# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -57,6 +59,7 @@ function big_console_header
true
}

# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -66,7 +69,7 @@ function add_test
true
}


# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand Down Expand Up @@ -303,6 +306,7 @@ function gitam_dryrun
fi
}

# shellcheck disable=SC2317
## @description git am signoff
## @replaceable no
## @audience private
Expand All @@ -313,12 +317,12 @@ function gitam_apply
declare gpg=$2

if [[ ${gpg} = true ]]; then
EXTRA_ARGS="-S"
EXTRA_ARGS+=("-S")
fi

echo "Applying the patch:"
yetus_run_and_redirect "${PATCH_DIR}/apply-patch-git-am.log" \
"${GIT}" am --signoff ${EXTRA_ARGS} --whitespace=fix "-p${PATCH_LEVEL}" "${patchfile}"
"${GIT}" am --signoff "${EXTRA_ARGS[@]}" --whitespace=fix "-p${PATCH_LEVEL}" "${patchfile}"
RESULT=$?
"${GREP}" -v "^Checking" "${PATCH_DIR}/apply-patch-git-am.log"

Expand All @@ -329,6 +333,7 @@ function gitam_apply
fi
}

# shellcheck disable=SC2317
## @description get author and summary from jira and commit it.
## if the author and the summary contains " or *,
## the function does not work correctly because
Expand Down Expand Up @@ -370,7 +375,7 @@ function gitapply_and_commit
"${GIT}" add --all
echo "Committing with author: ${author}, summary: ${summary}"
yetus_run_and_redirect "${PATCH_DIR}/apply-patch-git-am-fallback.log" \
"${GIT}" commit ${EXTRA_ARGS} --signoff -m "${PATCH_OR_ISSUE}. ${summary}" \
"${GIT}" commit "${EXTRA_ARGS[@]}" --signoff -m "${PATCH_OR_ISSUE}. ${summary}" \
--author="${author}"
}

Expand Down