5

I'm using Subversion to checkin a file on OSX. I have my EDITOR variable configured to MacVim

My .profile includes:

export EDITOR=/Applications/MacVim/mvim

When I checkin with the -m option (svn ci somefile), MacVim gets launched but then Subversion immediately displays:

Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:

It displays this before I get a chance to save my log message in MacVim.

Is there a way to get SVN to use MacVim as the log message editor?

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
Steve Kuo
  • 61,876
  • 75
  • 195
  • 257

4 Answers4

11

You need to run mvim with the -f flag so that it stays in the foreground. By default, it forks and returns control to the terminal which makes subversion think it is done.

jamessan
  • 41,569
  • 8
  • 85
  • 85
4

Apple Terminal:

export EDITOR='mvim -f -c "au VimLeave * !open -a Terminal"'

or for iTerm or iTerm2:

export EDITOR='mvim -f -c "au VimLeave * !open -a iTerm"'

From "Faq - macvim - GitHub: How can I use MacVim to edit Git commit messages?". I've confirmed that it works with Subversion, as well.

TimZehta
  • 391
  • 3
  • 4
0

See open --help:

-W, --wait-apps Blocks until the used applications are closed (even if they were already running).

export EDITOR="open --wait -a /Applications/MacVim/mvim"

If the above doesn't work, you may need to put it into shell script and make $EDITOR to point that script. [EDIT: doesn't work, see the comment below.]

jholster
  • 5,066
  • 1
  • 27
  • 20
  • 1
    open would work for the `MacVim.app` application bundle. `mvim` is the command line tool, which would require the `-f` flag described above. – Dav Clark Feb 11 '11 at 02:08
0

I'm using textmate as my svn editor and I had the same problem you had. But my solution is to set textmate to wait until the file is closed.

I added this in my .bash_profile

export SVN_EDITOR="mate -w"

-w is for wait

RoundOutTooSoon
  • 9,821
  • 8
  • 35
  • 52