Repository navigation
PR descriptions based on commit messages interact poorly with GitHub's idiosyncratic line wrapping #839
|
Suppose I create a commit with the following body, nicely wrapped at the standard 72 characters. If I put this as the only commit on a new branch, and run # Commit message summary
Commit message body. Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat.This ought to be correct, but, GitHub inserts line breaks in the middle of the Markdown paragraphs, so the PR body ends up looking like this
rather than wrapping naturally. This seems to be more GitHub's fault than Forge's, but I'm not sure they're going to fix it. It might be nice for Forge to delete these line breaks automatically for PRs to GitHub. |
Replies: 2 comments 1 reply
|
I don't think that either preserving the line-breaks or automatically unfilling paragraphs is always the right move. Erring on the side of preserving formatting seems like the safer, though often ugly, choice. It would probably be best if users explicitly unfilled paragraphs when appropriate. The |
|
That seems sensible enough to me. If it's useful to anybody else, one can enable automatic wrapping with the (with-eval-after-load 'forge
(advice-add 'forge-create-pullreq-insert-single-commit-message :after
(lambda () (when (eq forge-edit-post-action 'new-pullreq)
(unfill-region (point-min) (point-max)))))) |
I don't think that either preserving the line-breaks or automatically unfilling paragraphs is always the right move. Erring on the side of preserving formatting seems like the safer, though often ugly, choice. It would probably be best if users explicitly unfilled paragraphs when appropriate. The
unfillpackage can be used for that.