Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index 7b708fc5b35b4cad7892343678d6ebaacb66ed40..0bad4d44e48eb6340f34e4f963326c80adf58ad0 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -243,6 +243,7 @@ class Settings(object): |
self.viewvc_url = None |
self.updated = False |
self.is_gerrit = None |
+ self.git_editor = None |
def LazyUpdateIfNeeded(self): |
"""Updates the settings from a codereview.settings file, if available.""" |
@@ -367,6 +368,12 @@ class Settings(object): |
self.is_gerrit = self._GetConfig('gerrit.host', error_ok=True) |
return self.is_gerrit |
+ def GetGitEditor(self): |
+ """Return the editor specified in the git config, or None if none is.""" |
+ if self.git_editor is None: |
+ self.git_editor = self._GetConfig('core.editor', error_ok=True) |
+ return self.git_editor or None |
+ |
def _GetConfig(self, param, **kwargs): |
self.LazyUpdateIfNeeded() |
return RunGit(['config', param], **kwargs).strip() |
@@ -848,7 +855,8 @@ class ChangeDescription(object): |
if '\nBUG=' not in self._description: |
self.append_footer('BUG=') |
- content = gclient_utils.RunEditor(self._description, True) |
+ content = gclient_utils.RunEditor(self._description, True, |
+ git_editor=settings.GetGitEditor()) |
if not content: |
DieWithError('Running editor failed') |