UltraEdit as GIT_EDITOR?

UltraEdit as GIT_EDITOR?

71
NewbieNewbie
71

    Apr 20, 2020#1

    I have UltraEdit (x64  26.20.0.68) set up as my EDITOR, and have been having some trouble with git commits.  If GIT_EDITOR (or various other configurations) are not set, git will use the EDITOR environment variable as its editor.  When I "git commit" it opens UE to allow me to specify a check-in message.  While git normally waits until the editor is closed before proceeding, with UE as the editor it attempts to proceed immediately, sees that the check-in message is blank, and fails.

    Does anyone know whether there is a command line I could put in the GIT_EDITOR environment variable to get git to work correctly with UE?

    6,605548
    Grand MasterGrand Master
    6,605548

      Apr 20, 2020#2

      GIT proceeds immediately because of the started instance of UltraEdit exits immediately. There are several options to avoid that.

      The first one is running UltraEdit executable with option /fni (force new instance) as first parameter. Then the started UltraEdit instance does not search for an already running instance to pass the arguments (file name(s)) to the already running instance and exit. I don't know if this is possible via the environment variable GIT_EDITOR.

      The second one is opening in UltraEdit Advanced - Settings or Configuration - Application layout - Miscellaneous and check the setting Maintain separate process for each file opened from external application. See help for details about this option. The instance of UltraEdit started by Git is in this case running in background without showing a window while the file name passed as argument to started UE instance is passed to already running instance for viewing and editing by the user. When the user closes the file in the instance with visible window, the foreground UE instance informs the background UE instance that it can exit now as the file is closed in foreground instance.

      The third one is opening in UltraEdit Advanced - Settings or Configuration - Application layout - Miscellaneous and check the setting Allow multiple instances to use by default multiple instances of UltraEdit instead of just one.

      Note: UltraEdit must be exited after changing a configuration setting to be active for new instances. The configuration settings are stored into INI file or Windows registry on exit of UltraEdit while being immediately applied on already running instance on which the modification on configuration was made by the user.
      Best regards from an UC/UE/UES for Windows user from Austria

      71
      NewbieNewbie
      71

        Apr 20, 2020#3

        It turns out that in a clean command line, I didn't have the EDITOR environment variable set, and I couldn't figure out how git decided to use it in the first place.   I was able to make it work correctly by editing C:\Users\<name>\.gitconfig like so:

        Code: Select all

        [core]
            editor = 'C:/Program Files/IDM Computer Solutions/UltraEdit/uedit64.exe' /fni
        (Note the forward slashes in place of the normal Windows backslashes.)
        Thanks for the help!