Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

[REQUEST] Commit aborts in specific scenario #627

Closed
Gert-dev opened this issue Feb 17, 2017 · 3 comments
Closed

[REQUEST] Commit aborts in specific scenario #627

Gert-dev opened this issue Feb 17, 2017 · 3 comments

Comments

@Gert-dev
Copy link

Hello

I've been experiencing an issue committing for a long time now, but never got around to posting about it since I didn't know the exact steps to reproduce it. I finally got around to doing that and hope that you'll be able to reproduce it using the same steps.

The problem is that in a specific scenario, committing fails with the message Aborting commit due to empty commit message.. The specific steps:

  1. Change file A. For convenience, let's name the changes to it changeset C1.
  2. Stage file A via the Stage Files menu.
  3. Activate the Commit command. The commit pane will open. Type a message inside it, but do not save it yet (i.e. do not complete the commit), leave it open instead.
  4. Make another change to file A. This is changeset C2.
  5. Add A via the Add command. This will stage changeset C2, on top of C1 - without this, a commit will only include changeset C1.
  6. Activate the - still open - editor that contained the previously typed commit message. Save it (i.e., completing the commit).
  7. The message "Aborting commit due to empty commit message." is shown and the commit fails.

The issue can be solved easily by just initiating another commit, but your previous commit message is lost - so if you were writing a book inside it to describe why you changed something and forgot to back that up or copy it, it's now gone.

I've pretty much learned to live with this issue by always copying my commit messages before saving, but I guess it's better if the issue is solved instead :-).

Thanks in advance

@akonwi
Copy link
Owner

akonwi commented Feb 21, 2017

Thanks for the reproduction instructions.

I'm not seeing this behavior though.
627

For future reference and while this is still an issue for you, the COMMIT_EDITMSG file is saved in the .git directory of the repo, so if the commit fails within atom or otherwise, that file should still contain your message until it gets overwritten on the next attempt to commit.

@Gert-dev
Copy link
Author

Gert-dev commented Feb 21, 2017

Thanks for the tip. You are right, it appears I missed a step in my description. At step 6:

Activate the - still open - editor that contained the previously typed commit message. Save it (i.e., completing the commit).

... I apparently wasn't activating the still open editor and saving it. I was actually running the Commit command again via the git-plus menu. This automatically activates the already open editor that still contains the previous message. If you save at that point, you get the error.

My apologies, I should have tested my own steps before posting the issue :-).

@akonwi akonwi closed this as completed in bd50bd3 Feb 21, 2017
@akonwi
Copy link
Owner

akonwi commented Feb 21, 2017

Ah I see. The new release fixes this and updates the diff if verbose commits are enabled when you re-run Git commit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants