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

1

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.

Disoblige answered 1/10, 2011 at 13:17 Comment(0)
T
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
Trothplight answered 27/11, 2011 at 11:32 Comment(1)
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_FILEVoussoir

© 2022 - 2024 — McMap. All rights reserved.