News for hackers. Stuff that matters.
Re:Write good git commit messages by u801e on Thursday December 13, 2018 @02:38PM (#18675283)
> Even better, use `git commit -p` and skip the staging area entirely.

If you end up staging the wrong hunk, then you will have to reset and recommit. With git add -p, you would only need to reset the hunk.

Re:Write good git commit messages by tome on Monday December 17, 2018 @06:44AM (#18698354)
You indeed have to recommit everything (which I prefer) but you don't have to reset anything (since nothing is in the staging area).
Re:Write good git commit messages by u801e on Tuesday December 18, 2018 @09:12PM (#18712466)
>> If you end up staging the wrong hunk, then you will have to reset and recommit

> you don't have to reset anything

You have to reset the branch pointer to the previous commit, but I think using the --amend switch may do that for you.

Re:Write good git commit messages by tome on Wednesday December 19, 2018 @06:57AM (#18715024)
If you exit the commit message editor so that it retuns a non-zero exit code to git then nothing is committed and nothing is staged.
Re:Write good git commit messages by dllthomas on Friday December 21, 2018 @01:27PM (#18735340)
With git, usually (maybe always?) exiting having saved an empty buffer is equivalent.