Skip to content

Commit feb8557

Browse files
committed
kernel_patch_verify: Make sure to use review_one.sh on ALL patches in the series
We currently test the top of the series, which is fine as long as it was a single patch.. but we need to check all patches in a series under test in the context of a range of patches.. So, make sure to do that. Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent ef087a0 commit feb8557

1 file changed

Lines changed: 31 additions & 16 deletions

File tree

kernel_patch_verify

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -432,22 +432,37 @@ series_ai_review() {
432432
echo "Warning: semcode not available, review quality may be reduced" 1>&2
433433
fi
434434

435-
# Run review_one.sh with the range for complete series review
436-
echo "Starting Claude review of complete series..." 1>&2
437-
( "$REVIEW_ONE_SH" --linux "$KDIR" --range "$range" "$end_sha" || echo "AI review failed for series" ) | tee $LOG_DIR/ai-review.log
438-
439-
# Clean up the worktree created by review_one.sh
440-
local worktree_dir="$KDIR.$end_sha"
441-
if [ ! -d "$worktree_dir" ]; then
442-
worktree_dir="/tmp/linux.$end_sha"
443-
fi
444-
if [ -d "$worktree_dir" ]; then
445-
echo "Cleaning up worktree: $worktree_dir" 1>&2
446-
( cd "$KDIR" && git worktree remove --force "$worktree_dir" 2>&1 ) 1>&2
447-
else
448-
# Directory may be missing but worktree still registered, prune it
449-
( cd "$KDIR" && git worktree prune 2>&1 ) 1>&2
450-
fi
435+
# Get list of all commits in the series
436+
local commits=()
437+
while IFS= read -r sha; do
438+
commits+=("$sha")
439+
done < <(git -C "$KDIR" rev-list --reverse "${start_sha}..${end_sha}")
440+
441+
# Run review_one.sh for each commit in the series
442+
echo "Starting Claude review of $PATCHCOUNT patches in series..." 1>&2
443+
local patch_num=1
444+
for commit_sha in "${commits[@]}"; do
445+
local short_sha="${commit_sha:0:12}"
446+
local subject=$(git -C "$KDIR" log -1 --format="%s" "$commit_sha")
447+
echo "[$patch_num/$PATCHCOUNT] Reviewing $short_sha: $subject" 1>&2
448+
449+
( "$REVIEW_ONE_SH" --linux "$KDIR" --range "$range" "$commit_sha" || echo "AI review failed for $short_sha" ) | tee -a $LOG_DIR/ai-review.log
450+
451+
# Clean up the worktree created by review_one.sh
452+
local worktree_dir="$KDIR.$commit_sha"
453+
if [ ! -d "$worktree_dir" ]; then
454+
worktree_dir="/tmp/linux.$commit_sha"
455+
fi
456+
if [ -d "$worktree_dir" ]; then
457+
echo "Cleaning up worktree: $worktree_dir" 1>&2
458+
( cd "$KDIR" && git worktree remove --force "$worktree_dir" 2>&1 ) 1>&2
459+
else
460+
# Directory may be missing but worktree still registered, prune it
461+
( cd "$KDIR" && git worktree prune 2>&1 ) 1>&2
462+
fi
463+
464+
patch_num=$((patch_num + 1))
465+
done
451466

452467
echo "AI review of series complete" 1>&2
453468
fi

0 commit comments

Comments
 (0)