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

When using a gui text editor (for example, editing komodo) as the main editor for git (fixing messages), this editor process should not be forked, otherwise git will accept an empty commit message because it "thinks" the editor will already be finished, not returning text to use as a commit message. But I could not find any version of the command line (under ubuntu) for editing komodo, so as not to fork at startup and not even hinted at the network so far. For example, for the gVim editor, there is a -f command line parameter that forces the editor to not fork, so the process will only return to git after closing the editor.

So here is my question: is there a (simple) opportunity to use komodo editing in non-forking mode so that it can be used as the main editor for git commit messages?

With respect, Roman.

+6
source share
1 answer

The problem is that git does not know when you finish editing the file.

I would suggest writing a small wrapper script that can be as simple as this (not verified):

#!/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 hit enter. So your workflow will be as follows:

  • git commit calls the shell
  • shell opens Komodo
  • you edit the file in komodo and save it
  • It may decide to edit again because you forgot something.
  • Go back to git commit and press Enter
  • git commit continues
+4
source

Source: https://habr.com/ru/post/898441/


All Articles