Skip to content

Commit 67abd41

Browse files
sbohrertronical
authored andcommitted
git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
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> Signed-off-by: Simon Hausmann <simon@lst.de>
1 parent 8ff45f2 commit 67abd41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/fast-import/git-p4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,8 @@ class P4Submit(Command):
627627

628628
if self.interactive:
629629
submitTemplate = self.prepareLogMessage(template, logMessage)
630+
if os.environ.has_key("P4DIFF"):
631+
del(os.environ["P4DIFF"])
630632
diff = read_pipe("p4 diff -du ...")
631633

632634
for newFile in filesToAdd:

0 commit comments

Comments
 (0)