4 ms·
In my experience, the benefit you get is from giving you an editor to edit the commit message, which has a list of files changed, and can be cancelled in some w
by jcranmer 9y ago
In my experience, the benefit you get is from giving you an editor to edit the commit message, which has a list of files changed, and can be cancelled in some way to abort the commit. Both hg and git can do this, so it's not necessary to have a separate command and staging area just to do it.
- icebraining 9y agoList of files is not enough, I always do 'git add -p' to see the actual changes. And sometimes I detect an error, and I want to fix it and then keep going without having to re-evaluate the changes I had already seen.
- MaxBarraclough 9y agoMy preference is for `git commit --verbose`, which shows all changes in a 'commented-out' section of the commit message file.
- ryanbrunner 9y agoThe authour of this article suggests a solution - `git commit --interactive` could prompt you for each change like `git add -p` does without needing a staging error. You're right though that it would take some cleverness in that command to allow you to fix a typo without restarting the operation.
- masklinn 9y ago> You're right though that it would take some cleverness in that command to allow you to fix a typo without restarting the operation. Would it though? Just finish your commit ("q" to skip the current hunk and every following one), then use commit --amend —interactive for the rest of the changes.
- jhasse 9y agoAlso you still haven't pushed the commit and could undo it.