1

Possible Duplicate:
How do I get git to use Textmate as my default editor?

When I type git commit...it launches TextMate and I see all the changes in the file commented out.

But then at the command line, I see this (basically immediately as TextMate was launched):

Aborting commit due to empty commit message.

If I type something in the TextMate window and close it, the commit doesn't happen. I still see everything unstaged.

Edit 1: When I do git commit -am <some message>, that works just fine.

Edit 2:

My .bash_profile looks like this:

alias mate='open -a TextMate.app'
export EDITOR="/usr/bin/mate -w"

Help!

Community
  • 1
  • 1
marcamillion
  • 32,933
  • 55
  • 189
  • 380
  • so.. what do you have on your textmate launch command now in your configuration? :) did you use that open command or what? – eis Aug 31 '12 at 10:50
  • I updated the question to show you what my `.bash_profile` looks like right now. – marcamillion Aug 31 '12 at 11:01
  • While I think this is a duplicate, I'll also say that you're trying to run '/usr/bin/mate', but that file doesn't exist: mate is an alias. Try expanding your alias in your export. – Andrew Aylett Aug 31 '12 at 11:03
  • @marcamillion do you have anything on your ~/.gitconfig besides this? EDITOR looks correct, but if your git uses "mate" directly, bypassing EDITOR env var, then you'd get this behaviour. – eis Aug 31 '12 at 11:08
  • @AndrewAylett um, the user says that the editor opens, so it exists. In the question you linked the executable didn't exist, so the behaviour was like that. This is a different question as the editor is now found but git is not waiting for input (or technically a follow-up to that one, root cause still being problem with conf). – eis Aug 31 '12 at 11:10
  • @marcamillion also please provide the output of `git config -l` – eis Aug 31 '12 at 11:13
  • @eis: Good point, marcamillion: Sorry, my bad :(. – Andrew Aylett Aug 31 '12 at 14:18

1 Answers1

1

Based on your previous question, I'm doing some guessing.

You have this in your .gitconfig:

[core]
    editor = mate

and this in your .bash_profile:

alias mate='open -a TextMate.app'
export EDITOR="/usr/bin/mate -w"

which would mean that your .gitconfig would override EDITOR env variable. You either want to a) fix core.editor directive or b) remove it, since your EDITOR env variable should be enough.

So, I would suggest removing editor = mate line from your .gitconfig altogether as it is supposed to work with your EDITOR env variable.

Community
  • 1
  • 1
eis
  • 51,991
  • 13
  • 150
  • 199