Как настроить gedit как git core.editor?

У меня gedit настроен как git core.editor.

git config --global core.editor "gedit"

Это отлично работает, если не открываются окна gedit. В этом случае COMMIT_EDITMSG открывается в существующем окне, и gedit немедленно возвращается. git заканчивается пустым сообщением о коммит и не выполняется.

Этот сайт (http://fabianschuiki.wordpress.com/2012/05/20/use-gedit-as-git-editor/) предлагает использовать "gedit -s -w", но у меня нет этих параметров (и -new-window doesn работа):

$ gedit -V
gedit - Version 2.28.4

$ gedit --help
Usage:
  gedit [OPTION...] [FILE...] - Edit text files

Help Options:
  -h, --help                      Show help options
  --help-all                      Show all help options
  --help-gtk                      Show GTK+ Options
  --help-sm-client                Show session management options

Application Options:
  -V, --version                   Show the application version
  --encoding=ENCODING             Set the character encoding to be used to open the files listed on the command line
  --list-encodings                Display list of possible values for the encoding option
  --new-window                    Create a new toplevel window in an existing instance of gedit
  --new-document                  Create a new document in an existing instance of gedit
  --display=DISPLAY               X display to use

Ответ 1

Самый простой способ решить эту проблему - обновить gedit (что на 3.8.3 с помощью Ubuntu 13.10)

В 3.x, -s (автономный) и -w (ожидание) доступны.
Это позволяет (как прокомментировать Fortisimo):

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

Как Gábor Lipták комментарии ниже, это работает с gedit3, который устанавливается с помощью:

sudo apt-get install gedit-common/trusty 
sudo apt-get install gedit/trusty

(в Linux Mint)

Ответ 2

Весь кредит на ответ VonC, но -w делает gedit (3.18) сбой на моем ubuntu 16.04. Прекрасно работает, хотя:

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