git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Unset P4DIFF environment variable when using 'p4 -du diff'
Date: Wed, 12 Mar 2008 19:03:23 -0500	[thread overview]
Message-ID: <1205366604-12970-1-git-send-email-shawn.bohrer@gmail.com> (raw)
In-Reply-To: <>

A custom diffing utility can be specified for the 'p4 diff' command by
setting the P4DIFF environment variable.  However when using a custom
diffing utility such as 'vimdiff' passing options like -du can cause
unexpected behavior.

Since the goal is to generate a unified diff of the changes and attach
them to the bottom of the p4 submit log we should unset P4DIFF if it
has been set in order to generate the diff properly.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
---
 contrib/fast-import/git-p4 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 650ea34..0b46084 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -627,6 +627,8 @@ class P4Submit(Command):
 
         if self.interactive:
             submitTemplate = self.prepareLogMessage(template, logMessage)
+            if os.environ.has_key("P4DIFF"):
+                del(os.environ["P4DIFF"])
             diff = read_pipe("p4 diff -du ...")
 
             for newFile in filesToAdd:
-- 
1.5.4.3

             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 Shawn Bohrer [this message]
2008-03-13  0:03 ` [PATCH] git-p4: Use P4EDITOR environment variable when set Shawn Bohrer

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-1-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).