git p4: Use git diff-tree instead of format-patch

The output of git format-patch can vary with user preferences. In
particular setting diff.noprefix will break the "git apply" that
is done as part of "git p4 submit".

Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Crestez Dan Leonard <cdleonard@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Crestez Dan Leonard 2013-11-21 17:19:03 +02:00 committed by Junio C Hamano
parent becb4336cb
commit 109efbe4f2

View File

@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):
else:
die("unknown modifier %s for %s" % (modifier, path))
diffcmd = "git format-patch -k --stdout \"%s^\"..\"%s\"" % (id, id)
diffcmd = "git diff-tree -p \"%s\"" % (id)
patchcmd = diffcmd + " | git apply "
tryPatchCmd = patchcmd + "--check -"
applyPatchCmd = patchcmd + "--check --apply -"