Live data from Hacker News

Why you should use a terminal editor to write a commit message

joaomagfreitas.link

11–20 of 32 posts

Re: Why you should use a terminal editor to write a commit message

#11

1, 2.: This expense of time is about as much as it takes for the editor to open, and then to close it again. 4. Pre-commit hooks are an anti-pattern. The repo creator has no business messing with my local, half-broken experiment/exploration commits. Do that on push if you must. 5. The dual: oh, you passed the wrong flags to commit and you remembered this after you started to write the commit message? Too bad, the mes…

You can use -m multiple times to create multiline commit messages.

Re: Why you should use a terminal editor to write a commit message

#15

1, 2.: This expense of time is about as much as it takes for the editor to open, and then to close it again. 4. Pre-commit hooks are an anti-pattern. The repo creator has no business messing with my local, half-broken experiment/exploration commits. Do that on push if you must. 5. The dual: oh, you passed the wrong flags to commit and you remembered this after you started to write the commit message? Too bad, the mes…

You can use -m multiple times to create multiline commit messages.

Plus multi-line work (in zsh at least) when using quotes.

Re: Why you should use a terminal editor to write a commit message

#16
Feeling that these are mostly nitpicks to be honest:

- The first two reasons are quickly invalidated once muscle memory is in place.

- I rarely break line and keep my commit messages short, but that depends of your workflow I guess, in my case the information is mostly in the linked ticket.

- If you accidentaly press enter and need to amend, you don't need to write the message again, just edit the part you want in the editor.

- My terminal do not have render issues.

- For the pre-commit hook it's been a while since I used one on commit messages, but how does it check the message validity before commiting using a terminal editor ?

TL;DR: the only point I found applicable in my case is the argument on special characters (such as $), but it never happened to me for now

Re: Why you should use a terminal editor to write a commit message

#18
Wait do people write all their commit messages with `-m`? No wonder they're always so bad.

I use an editor to write commit messages because it lets me take my time, to format them, to edit them after the initial draft.

If I know the message will be under 50 characters, I might use `-m`, but the rest of the time I want an editor.

Always relevant: https://cbea.ms/git-commit/

Re: Why you should use a terminal editor to write a commit message

#19
post #13

This is a joke, right?

This sounds more like a post by the Senior Dev that you don't want on your team. It's a commit message, use whatever is quickest/easiest for you...

Seems more like the opinions of a beginner who’s just recently discovered the joy of the terminal, and is in the zealous honeymoon phase, to me.
Post reply on HN