vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Unwrap 72-character wrapped commit message lines when creating PRs

Open Copilot opened this issue 2 months ago • 0 comments

When creating a PR from a single commit, the extension now unwraps commit message body lines that were wrapped at 72 characters, matching GitHub's native behavior.

Changes

  • Added unwrapCommitMessageBody function: Joins consecutive non-formatted lines while preserving:

    • Blank lines (paragraph breaks)
    • List items (-, *, +, numbered)
    • Blockquotes (>)
    • Indented code blocks
  • Updated titleAndBodyFrom: Applies unwrapping to commit message bodies before setting PR description

  • Test coverage: Added 9 test cases for wrapped paragraphs, lists, quotes, indented blocks, and mixed content

Example

Before:

This is a long commit message that has been wrapped at 72
characters to fit conventional Git formatting standards.

After:

This is a long commit message that has been wrapped at 72 characters to fit conventional Git formatting standards.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/node/20.19.6/x64/bin/node node ./out/src/test/runTests.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Join commit message lines on PR creation</issue_title> <issue_description>Both on GitHub and this extension, there's functionality where if you're creating a PR from a single commit, it will use the commit subject as the PR title and the commit message body as the PR description. In Git commits, it's conventional to wrap commit messages at 72 characters (VS Code even has a default ruler for this) for command-line tooling.

In GitHub, there's some smartness to unwrap those lines when translating the commit message body into the PR description. It would be nice if this extension had that functionality as well.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes microsoft/vscode-pull-request-github#5740

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Dec 10 '25 09:12 Copilot