UNIX的なアレ

UNIX的なこととかいろいろ

git pullでcommit message用にエディタが立ち上がったら

とある日からgit pullするとcommit message用にエディタが立ち上がるようになってしまいました。 mergedなんちゃらみたいなmessageがフィルインされている状態でエディタが立ち上がってしまいます。 コマンドライン上から使っている分には対して問題にならないのですが、magit上からだと結構こまります。予想外の動きをしてしまうので、processが終了してくれないんです。

原因となる理由が見つからなかったのですが、どうやらgitの1.7.10からなったようです。

From this release on, the "git merge" command in an interactive session will start an editor when it automatically resolves the merge for the user to explain the resulting commit, just like the "git commit" command does when it wasn't given a commit message.

If you have a script that runs "git merge" and keeps its standard input and output attached to the user's terminal, and if you do not want the user to explain the resulting merge commits, you can export GIT_MERGE_AUTOEDIT environment variable set to "no", like this:

https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.10.txt

とのことで、環境変数にセットすればいいみたいです。.bashrcに以下を追記していままで通りに戻りました。

export GIT_MERGE_AUTOEDIT=no