Skip to content

Commit ebef5cc

Browse files
committed
checkpatch: pretty commit ref in summary
Use a link for the SHA and code for the commit title. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent b2a58bd commit ebef5cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

entrypoint.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ COMMIT_TOP="" # filled below
3737
COMMIT_BOTTOM="" # filled below
3838
TMPFILE="" # filled below
3939
KSFT_PATH="tools/testing/selftests/net/mptcp"
40+
COMMIT_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit"
4041

4142
# Sparse
4243
SPARSE_URL_BASE="https://mirrors.edge.kernel.org/pub/software/devel/sparse/dist/"
@@ -633,6 +634,10 @@ check_compilation() {
633634
## Checkpatch ##
634635
################
635636

637+
get_commit_md() {
638+
git log --format=format:"[%h](${COMMIT_URL}/%H) (\`%s\`)" -1 HEAD
639+
}
640+
636641
CHECKPATCH_DETAILS="./checkpatch-details.txt"
637642
_checkpatch() {
638643
./scripts/checkpatch.pl \
@@ -641,7 +646,7 @@ _checkpatch() {
641646
-g HEAD 2>&1 | tee "${TMPFILE}" >&2
642647

643648
{
644-
echo "- Commit $(git log --oneline --no-decorate -1 HEAD):"
649+
echo "- Commit $(get_commit_md):"
645650
echo "\`\`\`"
646651
cat "${TMPFILE}"
647652
echo "\`\`\`"
@@ -711,7 +716,7 @@ _shellcheck() { local dname fname workdir
711716
shellcheck() { local sum status ksft out
712717
log_section_start_commit "shellcheck"
713718

714-
echo -n "- Commit $(git log --oneline --no-decorate -1 HEAD):" >> "${SHELLCHECK_DETAILS}"
719+
echo -n "- Commit $(get_commit_md):" >> "${SHELLCHECK_DETAILS}"
715720
if commit_has_modified_selftests_sh_code; then
716721
echo >> "${SHELLCHECK_DETAILS}"
717722
for ksft in $(commit_get_modified_selftests_sh_code); do

0 commit comments

Comments
 (0)