Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use komodo edit as git core.editor (i.e. without forking)?

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.

like image 919
RSeidelsohn Avatar asked Oct 01 '11 13:10

RSeidelsohn


People also ask

What is the difference between Komodo Edit and Komodo IDE?

Komodo Edit is the leading free multi-language code editor (Python, Perl, Ruby, HTML/CSS, Javascript and more) for programming and web development. However, Komodo IDE provides more features such as debugging and unit testing, and is now free for everyone! Download Komodo IDE.

What should I use as default editor in git?

On Windows, if you use Git Bash the default editor will be Vim. Vim is another text editor, like nano or notepad.

Can you change Git default editor?

Luckily, Git allows you to change the editor that gets opened by default very easily! There are two ways in which this can be done. The first is via the terminal; this is useful if you want your editor to be Nano, for example. The command to do this is git config --global core.

Is Komodo edit a text editor?

Komodo Edit is a free and open source text editor for dynamic programming languages.


1 Answers

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
like image 191
ZeissS Avatar answered Oct 01 '22 09:10

ZeissS