Skip to content

Commit 013a91f

Browse files
committed
getting closer
1 parent be94cc0 commit 013a91f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/upstream-fix-check.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,20 @@ jobs:
111111
"$PR_COMMENT_BODY_ACCUMULATOR" "$UPSTREAM_LINUX_HASH"
112112
113113
# --- Search for "Fixes:" tag in upstream Linux kernel using git log ---
114-
printf -v PR_COMMENT_BODY_ACCUMULATOR "%s Searching for upstream commits on 'master' branch in range \`%s..%s\` that fix \`%s\` using \`git log\`...\n" \
115-
"$PR_COMMENT_BODY_ACCUMULATOR" "$UPSTREAM_LINUX_HASH" "$HEAD_COMMIT_SHA" "$UPSTREAM_LINUX_HASH"
114+
# Extract the first 12 characters for the short SHA, commonly used in Fixes: tags in Linux kernel.
115+
UPSTREAM_LINUX_HASH_SHORT=$(echo "$UPSTREAM_LINUX_HASH" | cut -c 1-12)
116+
117+
printf -v PR_COMMENT_BODY_ACCUMULATOR "%s Searching for upstream commits on 'master' branch in range \`%s..%s\` that fix \`%s\` using \`git log --grep=\"Fixes: %s\"\`...\n" \
118+
"$PR_COMMENT_BODY_ACCUMULATOR" "$UPSTREAM_LINUX_HASH" "$HEAD_COMMIT_SHA" "$UPSTREAM_LINUX_HASH" "$UPSTREAM_LINUX_HASH_SHORT"
116119
117-
# Construct the grep pattern using the full SHA for precise matching.
118-
GREP_PATTERN="Fixes: ${UPSTREAM_LINUX_HASH}"
120+
# Construct the grep pattern using the SHORT SHA for search.
121+
GREP_PATTERN="Fixes: ${UPSTREAM_LINUX_HASH_SHORT}"
119122
120-
# Use git log to find commits that mention the full SHA in their "Fixes:" line,
123+
# Use git log to find commits that mention the short SHA in their "Fixes:" line,
121124
# in the range from the specific commit up to HEAD.
122125
# --pretty=format:"%h %s" to get short SHA and subject.
123126
# --regexp-ignore-case for case-insensitive grep.
124-
# We explicitly exclude the UPSTREAM_LINUX_HASH itself from the result,
127+
# We explicitly exclude the UPSTREAM_LINUX_HASH itself from the result range,
125128
# as we are looking for *subsequent* fixes.
126129
GIT_LOG_FIXES_OUTPUT=$(git -C linux log master \
127130
"${UPSTREAM_LINUX_HASH}..${HEAD_COMMIT_SHA}" \

0 commit comments

Comments
 (0)