git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv4 3/5] git p4: Ignore P4EDITOR if it is empty

From
Luke Diamand <luke@diamand.org>
Date
Apr 24, 2012, 08:33 UTC
Message-ID
<1335256403-22162-4-git-send-email-luke@diamand.org>
In-Reply-To
<1335256403-22162-1-git-send-email-luke@diamand.org>

p4 itself treats an empty value for P4EDITOR as the same as having P4EDITOR unset. Do the same for "git p4".

Signed-off-by: Luke Diamand <luke@diamand.org>
---
 git-p4.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index f910d5a..ead0c44 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -970,7 +970,7 @@ class P4Submit(Command, P4UserMap):
         mtime = os.stat(template_file).st_mtime
 
         # invoke the editor
-        if os.environ.has_key("P4EDITOR"):
+        if os.environ.has_key("P4EDITOR") and (os.environ.get("P4EDITOR") != ""):
             editor = os.environ.get("P4EDITOR")
         else:
             editor = read_pipe("git var GIT_EDITOR").strip()
-- 
1.7.10.8.g12781
Previous: Luke DiamandNext: Luke Diamand
Message 4 of 6 in “[PATCHv4 0/5] git p4: label import/export: documentation fix”
  1. Luke DiamandApr 24, 2012
  2. 1/5 git p4: Fixing script editor checksLuke Diamand, Apr 24, 2012
  3. 2/5 git p4: Squash P4EDITOR in test harnessLuke Diamand, Apr 24, 2012
  4. 3/5 git p4: Ignore P4EDITOR if it is emptyLuke Diamand, Apr 24, 2012
  5. 4/5 git p4: import/export of labels to/from p4Luke Diamand, Apr 24, 2012
  6. 5/5 git p4: move verbose to base classLuke Diamand, Apr 24, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.