Upstream Commit Checker. - #80
Open
PlaidCat wants to merge 1 commit into
Open
Conversation
This is a quickly written script that Claude built based off many of LPE and embargo's we've needed to address over the past 3 months. This should be decomposed into kt libraries more specifically but is here just so we have something to share quickly.
There was a problem hiding this comment.
Pull request overview
Adds a new Bash utility (check-upstream-commit.sh) intended to help triage whether a given upstream commit SHA is present (directly or via backport references) across a set of CIQ-maintained kernel branches, with optional fetch, verbose output, quiet filtering, and JSON output.
Changes:
- Introduces
check-upstream-commit.shto check commit ancestry across a fixed branch set plus latest-per-family RLC branches. - Implements two detection modes: message grep for backport references and direct ancestry checks for the upstream commit object.
- Adds multiple output formats (human table with optional color, and JSON).
Suppressed comments (2)
check-upstream-commit.sh:139
- When reading SHAs from
--file, the script removes only literal spaces (line="${line// /}"). Files with tabs or CRLF line endings (common when copying from emails/spreadsheets) will leave extra whitespace and then failvalidate_sha. Strip all whitespace characters to make file input more robust.
while IFS= read -r line; do
line="${line%%#*}"
line="${line// /}"
[[ -n "$line" ]] && SHA_LIST+=("$line")
check-upstream-commit.sh:346
- The JSON output only escapes backslashes and double quotes in
details. If a commit subject contains tabs/newlines/CR (or other control chars), the emitted JSON becomes invalid. At minimum, escape\n,\r, and\tas well (and ideally apply escaping consistently to other string fields likebranch/label).
if [[ -n "$details" ]]; then
details_escaped="${details//\\/\\\\}"
details_escaped="${details_escaped//\"/\\\"}"
json_results+=",\"details\":\"${details_escaped}\""
fi
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+6
to
+9
| # Usage: | ||
| # ./scripts/check-upstream-commit.sh <sha> [sha2 ...] | ||
| # ./scripts/check-upstream-commit.sh -f file_of_shas.txt | ||
| # ./scripts/check-upstream-commit.sh --fetch <sha> |
Comment on lines
+122
to
+126
| -h|--help) usage;; | ||
| -f|--file) SHA_FILE="$2"; shift 2;; | ||
| -F|--fetch) FETCH=1; shift;; | ||
| -r|--remote) REMOTE="$2"; shift 2;; | ||
| -v|--verbose) VERBOSE=1; shift;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a quickly written script that Claude built based off many of LPE and embargo's we've needed to address over the past 3 months. This should be decomposed into kt libraries more specifically but is here just so we have something to share quickly.
NOTE ITS PRETTY SLOW but that is less important than the information at the moment
example with Januscape
Coverage Report