4 ms·
For those who write multi paragraph commit bodys, is there a tool you use to format them? Example commit on the React repo [1]. It just seems like a lot to typ
by themanmaran 4y ago
For those who write multi paragraph commit bodys, is there a tool you use to format them?
Example commit on the React repo [1]. It just seems like a lot to type in the command line.
[1] https://github.com/facebook/react/commit/ec52a5698e2dfea7050a0b015f0b79abfb2d81b7 https://github.com/facebook/react/commit/ec52a5698e2dfea7050...
- xorcist 4y agoCommand line? git normally opens your chosen editor and you are free to write away to your heart's content. I guess you could stuff multiple -m in there and git will format it nicely, but the editor is for writing and is best used for that.
- jrib 4y agoMy vim will automatically wrap when I am typing a git commit message. Should be set by default from here: https://github.com/vim/vim/blob/2f0936cb9a2eb026acac03e6a8fd0b2a5d97508b/runtime/ftplugin/gitcommit.vim#L13 https://github.com/vim/vim/blob/2f0936cb9a2eb026acac03e6a8fd...
- imron 4y agovi :set tw=70
- a_t48 4y agoThere's a good chance this was made in Github's squash+merge dialog. Edit: never mind, it's auto wrapped at some number
- knoebber 4y agoEmacs + magit and auto-fill-mode
- rubyist5eva 4y ago> It just seems like a lot to type in the command line. I spend my entire workday day in Vim.
- teeray 4y agoIf you don’t supply `-m`, `git` will pop open your `$EDITOR` with the new commit message. You can use whatever tools you like to wrangle text in there. I use vim, so it’s just a quick `gq<motion>` to format everything.
- ridiculous_fish 4y agoI write it as normal prose and then pipe through `fold -w 76 -s` to line break. TextMate makes this easy with its "Filter Through Command" menu item.