git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luke Diamand <luke@diamand.org>
To: git@vger.kernel.org
Cc: Pete Wyckoff <pw@padd.com>, Junio C Hamano <gitster@pobox.com>,
	Vitor Antunes <vitor.hda@gmail.com>,
	Luke Diamand <luke@diamand.org>
Subject: [PATCHv3 3/5] git p4: Ignore P4EDITOR if it is empty
Date: Tue, 24 Apr 2012 09:08:15 +0100	[thread overview]
Message-ID: <1335254897-15242-4-git-send-email-luke@diamand.org> (raw)
In-Reply-To: <1335254897-15242-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.381.gb484f

  parent reply	other threads:[~2012-04-24  8:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24  8:08 [PATCHv3 0/4] git p4: label import/export Luke Diamand
2012-04-24  8:08 ` [PATCHv3 1/5] git p4: Fixing script editor checks Luke Diamand
2012-04-24  8:08 ` [PATCHv3 2/5] git p4: Squash P4EDITOR in test harness Luke Diamand
2012-04-24  8:08 ` Luke Diamand [this message]
2012-04-24  8:08 ` [PATCHv3 4/5] git p4: import/export of labels to/from p4 Luke Diamand
2012-04-24  8:08 ` [PATCHv3 5/5] git p4: move verbose to base class Luke Diamand
2012-04-25 22:22 ` [PATCHv3 0/4] git p4: label import/export Pete Wyckoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335254897-15242-4-git-send-email-luke@diamand.org \
    --to=luke@diamand.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pw@padd.com \
    --cc=vitor.hda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).