4

When I issue the following command on 16.04 with Git 2.7.4 from the apt repository

git commit -sS --status

I get the following result:

Aborting commit due to empty commit message.

I have configured the Git global configuration as follows:

jonathan@Aristotle:~/EclipseWorkspaces/AGI$ git config --global -l
user.name=Jonathan Gossage
user.email=jgossage@gmail.com
core.editor=gedit

Given this configuration I expected Git to bring up the gedit editor to allow me to enter the commit message. This is the first commit into an empty repository. The git status is included as an attachment.

Jonathan
  • 1,280

2 Answers2

5

Configure your editor with -w option, also add -s to run a new instance of gedit on each call:

git config --global core.editor "gedit -w -s"

or (because of this bug in gedit) use a call with long arguments:

git config --global core.editor "gedit --wait --new-window"
techraf
  • 3,316
  • I tried this with the following response: jonathan@Aristotle:~/EclipseWorkspaces/AGI$ git commit -sS --status Failed to register: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "DescribeAll" with signature "" on interface "org.gtk.Actions" doesn't exist

    error: There was a problem with the editor 'gedit -w -s'. Please supply the message using either -m or -F option.

    – Jonathan May 19 '16 at 03:18
  • Check this. It seems some versions of gedit had a bug. One post suggests as a workaround to use long arguments gedit --wait --new-window in the command call (instead of -w -s). – techraf May 19 '16 at 03:47
0

I had the same problem setting up Atom as the default editor. After wasting one hour to make it work on my Ubuntu, I decided to use Sublime Text instead of Atom to write my commit messages.
So instead of:

git config --global core.editor "atom -w"

I used the same command for Sublime.

git config --global core.editor "subl -w"

And it worked fine.
Sublime pause waiting for the commit message.