6

When using a gui text editor (e.g. komodo edit) as core editor for git (commit messages), that editor process must not be forked or else git will assume an empty commit message, because it "thinks" the editor would already be finished without returning a text to use as commit message. But I couldn't find any command line option (under ubuntu) for komodo edit to not fork when launching and even no hint on the web so far. For the editor gVim for example there is the command line option -f which causes that editor not to fork, so that the process will only return to git after the editor is closed again.

So here goes my question: Is there any (simple) possibility to use komodo edit in a non-forking way so it can be used as core editor for git commit messages?

Regards, Roman.

RSeidelsohn
  • 1,042
  • 16
  • 29

1 Answers1

4

The problem is, that git has no way of knowning when you finished editing the file.

I would suggest writing a little wrapper script which can be as simple as this (not tested):

#!/bin/bash
THE_FILE=$1
komodo-edit -f $THE_FILE
echo "Press Enter when you have finished editing the file"
read

This should block the git commit process until you press enter. So you workflow would be:

  1. git commit invokes wrapper
  2. wrapper opens komodo
  3. you edit file in komodo and save it
  4. May decide to edit again, because you forgot something
  5. Tab back to git commit and press Enter
  6. git commit continues
ZeissS
  • 10,861
  • 4
  • 31
  • 49
  • Thanks, works perfectly. but small note: in komodo-edit-7 a one need to open a file with it without the `-f` option, simply `path/to/komodo-executable $THE_FILE` – Dmitry Koroliov Apr 09 '13 at 14:03