From: Shawn Bohrer <shawn.bohrer@gmail.com>
To: git@vger.kernel.org
Cc: simon@lst.de, Shawn Bohrer <shawn.bohrer@gmail.com>
Subject: [PATCH] git-p4: Use P4EDITOR environment variable when set
Date: Wed, 12 Mar 2008 19:03:24 -0500 [thread overview]
Message-ID: <1205366604-12970-2-git-send-email-shawn.bohrer@gmail.com> (raw)
In-Reply-To: <1205366604-12970-1-git-send-email-shawn.bohrer@gmail.com>
Perforce allows you to set the P4EDITOR environment variable to your
preferred editor for use in perforce. Since we are displaying a
perforce changelog to the user we should use it when it is defined.
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
---
contrib/fast-import/git-p4 | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 0b46084..55e38ff 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -652,7 +652,10 @@ class P4Submit(Command):
defaultEditor = "vi"
if platform.system() == "Windows":
defaultEditor = "notepad"
- editor = os.environ.get("EDITOR", defaultEditor);
+ if os.environ.has_key("P4EDITOR"):
+ editor = os.environ.get("P4EDITOR")
+ else:
+ editor = os.environ.get("EDITOR", defaultEditor);
system(editor + " " + fileName)
tmpFile = open(fileName, "rb")
message = tmpFile.read()
--
1.5.4.3
prev parent reply other threads:[~2008-03-13 0:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-13 0:03 [PATCH] git-p4: Unset P4DIFF environment variable when using 'p4 -du diff' Shawn Bohrer
2008-03-13 0:03 ` Shawn Bohrer [this message]
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=1205366604-12970-2-git-send-email-shawn.bohrer@gmail.com \
--to=shawn.bohrer@gmail.com \
--cc=git@vger.kernel.org \
--cc=simon@lst.de \
/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).