What kind of trick(s) you use to make the git commit messages nicely aligned to N characters when merging a PR in GitHub?

I sometimes copy to VS Code which has the "editor.ruler" option and manually edit the text, but surely someone has come up with something more convenient?

#developers #developerquestion #git #gittricks #development

@fohrloop I can create pull requests from within my editor thanks to Magit/Forge so I have all the advantages of the editor directly available.

#emacs #magit #forge

@slackline well that's a good point! Perhaps there's a possibility to make a PR from VS Code, too!
@fohrloop I teach a Git course where we use GitKraken which is a GUI Git Porcelain and it has the ability to create PRs so quite a high chance of there being a VSCode plugin to do so.
GitHub Pull Requests - Visual Studio Marketplace

Extension for Visual Studio Code - Pull Request and Issue Provider for GitHub

@olets @fohrloop Despite not using VSCode I went and looked that up earlier today.

It doesn't appear to list the ability to create Pull Requests though which is where the rub appears to be for @fohrloop

@slackline @fohrloop not listed in the overview but a feature. (Doesn't have an immediate solution for hard wrapping the commit message body though)
@fohrloop can you give an example of what you mean by "aligning commit messages to n characters when merging"?

@olets sure! What I meant that I many times have to manually edit the text taken from the PR web interface text box when making the merge commit (which will be also visible in git), so that each line has maximum of 72 characters.

If the limit was 12 chars, this could be an example

This is a message with too long line but it does not matter as it is wrapped automatically.

->

This is a
message with
too long
line but it
does not
matter as it
is wrapped
automatically.

@fohrloop got it makes sense. I usually let those lines go long, with silent apologies to folks using non-wrapping 80 char terminals