svn: system(’vi svn-commit.tmp’) returned 256

some-mac user$ svn ci some-file.M
svn: Commit failed (details follow):
svn: system(’vi svn-commit.tmp’) returned 256

I hate it, how I hate this. It just happened two times in a row, unbelievable! How the heck could Apple’s engineers think one can work with such kind of bugs in the system and/or tools?!?

13 Responses to “svn: system(’vi svn-commit.tmp’) returned 256”

  1. Alec Says:

    I know the cause, but not the solution: The problem is caused when you enter an invalid command in vim - it seems to tell vim ’something went wrong in this session’ so even if you do end up saving correctly vim still exits with 256. This manifests itself for me when I type “:Wq” instead of “:wq”, since “W” is not a valid vim command

    I really wish I knew how to tell vim to stop doing this.

  2. René Says:

    Interesting. I had the “feeling” it more often occurred when I used C-z (Ctrl-z) to SIGSTOP the editor into the background — for example to re-run “svn diff” to re-review the changes and/or even edit last-minute spotted typos away. Maybe it is indeed not some broken process handling and just their shipped vim returning wrong exit codes? Have to check by using another editor for the log messages for some weeks:-)

  3. Tim Says:

    Did you get this fixed, I have the exact problem (although substitute emacs with vi…not sure why)

  4. René Says:

    No. It just happened today three times in a row under Mac OS X 10.6.2. Still vi, though, …

  5. luis Says:

    I just got the same error on a 10.6.4 system and solved it by setting SVN_EDITOR=vi in my .bashrc file. Hope that helps.

  6. René Says:

    Not really – I use vi as EDITOR in my ~/.profile for years and still get this error daily. I think it has to do that Apple’s patched vi does sometimes return an error code although one intended to save the file and leave the editor cleanly. I get the impression that when you ESC out of the editing mode, or hit some other key that has no binding Apple’s patched vi returns and non-0 exit code, … and thus let svn commit abort.

  7. David Says:

    I solved this type of issue by setting this in .subversion/config
    editor-cmd = cat

    this will output the files that are to be committed but will not allow you to change them ….
    skiping straight trough to asking if you want to preceed.

  8. René Says:

    Yeah, but the whole point of the “edit” option is, well, do edit the text, … I mean, after all we want a useful commit message, to later retrieve what was going on, …

    As I wrote the other year, it’s probably simply that vi as shipped by Apple’s Mac OS X returns an error code after certain keyboard interaction, apparently when a keybinding was not valid or the visual mode left with ESC or so, … :-/

  9. dty Says:

    On Mac bash, I tried to set temporarily

    EDITOR=pico

    and it worked.

  10. René Says:

    Err? Beside setting the “EDITOR” variable was already proposed above, this changes the editor to “pico”, which is not exactly what I would want to use to edit my commit messages.

    As diagnosed in 2009 this is caused by “Apple’s” vim to exit with a non-zero exit code in case of there was an error in the last comment typed. I did not had the motivation to review if that is caused by an Apple specific patch to vim, a configuration option or any other kind of glitch.

  11. dty Says:

    For long term solution, put in bash profile if using MacVim:
    export SVN_EDITOR=’mvim -f’

  12. dty Says:

    if console MacVim,
    export SVN_EDITOR=’mvim -vf’

  13. loebre Says:

    what I was doing wrong is typing the “:wq” without pressing esc.
    when finish editing press esc then “:wq” it did the trick for me.
    hope it helps

Leave a Reply

You must be logged in to post a comment.