Skip to content

Commit

Permalink
git p4: Use git diff-tree instead of format-patch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Crestez Dan Leonard authored and Junio C Hamano committed Nov 22, 2013
1 parent becb433 commit 109efbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ def applyCommit(self, id):
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 -"
Expand Down

0 comments on commit 109efbe

Please sign in to comment.