{"thread":{"id":"35375","subject":"[PATCH] git p4: Use git diff-tree instead of format-patch","startedAt":"2013-11-21T15:19:03Z","lastAt":"2013-11-22T23:35:52Z","messageCount":4,"participants":["Crestez Dan Leonard","Junio C Hamano","Pete Wyckoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"230888","messageId":"528E2467.4030900@gmail.com","threadId":"35375","inReplyTo":null,"subject":"[PATCH] git p4: Use git diff-tree instead of format-patch","fromName":"Crestez Dan Leonard","fromEmail":"cdleonard@gmail.com","sentAt":"2013-11-21T15:19:03Z","receivedAt":"2013-11-21T15:19:03Z","isPatch":true,"sender":{"key":"cdleonard@gmail.com","avatar":null},"body":"\nThe output of git format-patch can vary with user preferences. In\nparticular setting diff.noprefix will break the \"git apply\" that\nis done as part of \"git p4 submit\".\n\nSigned-off-by: Crestez Dan Leonard <cdleonard@gmail.com>\n---\n  git-p4.py | 2 +-\n  1 file changed, 1 insertion(+), 1 deletion(-)\n\n\n\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 31e71ff..fe988ce 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):\n             else:\n                 die(\"unknown modifier %s for %s\" % (modifier, path))\n \n-        diffcmd = \"git format-patch -k --stdout \\\"%s^\\\"..\\\"%s\\\"\" % (id, id)\n+        diffcmd = \"git diff-tree -p \\\"%s\\\"\" % (id)\n         patchcmd = diffcmd + \" | git apply \"\n         tryPatchCmd = patchcmd + \"--check -\"\n         applyPatchCmd = patchcmd + \"--check --apply -\"\n\n"},{"id":"230898","messageId":"xmqqa9gx4jv6.fsf@gitster.dls.corp.google.com","threadId":"35375","inReplyTo":"528E2467.4030900@gmail.com","subject":"Re: [PATCH] git p4: Use git diff-tree instead of format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-11-21T19:47:57Z","receivedAt":"2013-11-21T19:47:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Crestez Dan Leonard <cdleonard@gmail.com> writes:\n\n> The output of git format-patch can vary with user preferences. In\n> particular setting diff.noprefix will break the \"git apply\" that\n> is done as part of \"git p4 submit\".\n>\n> Signed-off-by: Crestez Dan Leonard <cdleonard@gmail.com>\n> ---\n>  git-p4.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-p4.py b/git-p4.py\n> index 31e71ff..fe988ce 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):\n>              else:\n>                  die(\"unknown modifier %s for %s\" % (modifier, path))\n>  \n> -        diffcmd = \"git format-patch -k --stdout \\\"%s^\\\"..\\\"%s\\\"\" % (id, id)\n> +        diffcmd = \"git diff-tree -p \\\"%s\\\"\" % (id)\n>          patchcmd = diffcmd + \" | git apply \"\n>          tryPatchCmd = patchcmd + \"--check -\"\n>          applyPatchCmd = patchcmd + \"--check --apply -\"\n\nI do not do p4 myself, but from a cursory reading it looks like the\nright thing to do.  Thanks.\n\nThe output of \"git shortlog --no-merges --since=1.year git-p4.py\"\ntells me that Pete should be the person much more familiar with the\ncode than myself, so I'll Cc him just in case...\n"},{"id":"230979","messageId":"20131122231245.GA30589@padd.com","threadId":"35375","inReplyTo":"xmqqa9gx4jv6.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] git p4: Use git diff-tree instead of format-patch","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2013-11-22T23:12:45Z","receivedAt":"2013-11-22T23:12:45Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"gitster@pobox.com wrote on Thu, 21 Nov 2013 11:47 -0800:\n> Crestez Dan Leonard <cdleonard@gmail.com> writes:\n> \n> > The output of git format-patch can vary with user preferences. In\n> > particular setting diff.noprefix will break the \"git apply\" that\n> > is done as part of \"git p4 submit\".\n> >\n> > Signed-off-by: Crestez Dan Leonard <cdleonard@gmail.com>\n> > ---\n> >  git-p4.py | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/git-p4.py b/git-p4.py\n> > index 31e71ff..fe988ce 100755\n> > --- a/git-p4.py\n> > +++ b/git-p4.py\n> > @@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):\n> >              else:\n> >                  die(\"unknown modifier %s for %s\" % (modifier, path))\n> >  \n> > -        diffcmd = \"git format-patch -k --stdout \\\"%s^\\\"..\\\"%s\\\"\" % (id, id)\n> > +        diffcmd = \"git diff-tree -p \\\"%s\\\"\" % (id)\n> >          patchcmd = diffcmd + \" | git apply \"\n> >          tryPatchCmd = patchcmd + \"--check -\"\n> >          applyPatchCmd = patchcmd + \"--check --apply -\"\n> \n> I do not do p4 myself, but from a cursory reading it looks like the\n> right thing to do.  Thanks.\n> \n> The output of \"git shortlog --no-merges --since=1.year git-p4.py\"\n> tells me that Pete should be the person much more familiar with the\n> code than myself, so I'll Cc him just in case...\n\nThis looks great, and passes all my tests.\n\nAcked-by: Pete Wyckoff <pw@padd.com>\n\nThanks,\n\n\t\t-- Pete\n"},{"id":"230980","messageId":"xmqqmwkwyppj.fsf@gitster.dls.corp.google.com","threadId":"35375","inReplyTo":"20131122231245.GA30589@padd.com","subject":"Re: [PATCH] git p4: Use git diff-tree instead of format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-11-22T23:35:52Z","receivedAt":"2013-11-22T23:35:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}