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>

Crestez Dan Leonard committed Nov 21, 2013 at 17:19 UTC 109efbe4f24b1748f42af52ca6d528b2d7ffe048
1 file changed +1 -1
git-p4.py
+1 -1
@@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):
1308 else:
1309 die("unknown modifier %s for %s" % (modifier, path))
1310
1311 - diffcmd = "git format-patch -k --stdout \"%s^\"..\"%s\"" % (id, id)
1311 + diffcmd = "git diff-tree -p \"%s\"" % (id)
1312 patchcmd = diffcmd + " | git apply "
1313 tryPatchCmd = patchcmd + "--check -"
1314 applyPatchCmd = patchcmd + "--check --apply -"