Skip to content

fix: preserve original commit message content in get_pr_commit_messages()#190

Merged
shenxianpeng merged 2 commits intobugfix/issue-184from
copilot/sub-pr-188-again
Mar 16, 2026
Merged

fix: preserve original commit message content in get_pr_commit_messages()#190
shenxianpeng merged 2 commits intobugfix/issue-184from
copilot/sub-pr-188-again

Conversation

Copy link

Copilot AI commented Mar 16, 2026

get_pr_commit_messages() was calling strip() on each commit message, silently modifying content before passing it to commit-check for validation — masking real formatting violations like leading/trailing spaces.

Changes

  • main.py:57: Replace strip() with rstrip("\n") to only trim the trailing newline artifact from git log --pretty=format:%B%x00 output, preserving the original message content
  • Update the filter predicate from m.strip() to m.rstrip("\n") for consistency, correctly excluding empty NUL-terminator entries without discarding whitespace-only content
# Before
return [m.strip() for m in result.stdout.split("\x00") if m.strip()]

# After
return [m.rstrip("\n") for m in result.stdout.split("\x00") if m.rstrip("\n")]

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…sages

Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on PR commit message retrieval and validation implementation fix: preserve original commit message content in get_pr_commit_messages() Mar 16, 2026
Copilot AI requested a review from shenxianpeng March 16, 2026 22:59
@shenxianpeng shenxianpeng marked this pull request as ready for review March 16, 2026 23:25
@shenxianpeng shenxianpeng requested a review from a team as a code owner March 16, 2026 23:25
@shenxianpeng shenxianpeng merged commit 0509d6c into bugfix/issue-184 Mar 16, 2026
1 of 2 checks passed
@shenxianpeng shenxianpeng deleted the copilot/sub-pr-188-again branch March 16, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants