{"thread":{"id":"36494","subject":"[PATCH] git-p4: format-patch to diff-tree change breaks binary patches","startedAt":"2014-04-25T04:46:18Z","lastAt":"2014-05-05T13:14:56Z","messageCount":6,"participants":["Tolga Ceylan","Pete Wyckoff","tolga ceylan"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"239627","messageId":"20140425044618.GA7058@olive","threadId":"36494","inReplyTo":null,"subject":"[PATCH] git-p4: format-patch to diff-tree change breaks binary patches","fromName":"Tolga Ceylan","fromEmail":"tolga.ceylan@gmail.com","sentAt":"2014-04-25T04:46:18Z","receivedAt":"2014-04-25T04:46:18Z","isPatch":true,"sender":{"key":"tolga.ceylan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6537562?v=4"},"body":"When applying binary patches a full index is required. format-patch\nalready handles this, but diff-tree needs '--full-index' argument\nto always output full index.\n\nSigned-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>\n---\n git-p4.py |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex cdfa2df..4ee6739 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1311,7 +1311,7 @@ class P4Submit(Command, P4UserMap):\n             else:\n                 die(\"unknown modifier %s for %s\" % (modifier, path))\n \n-        diffcmd = \"git diff-tree -p \\\"%s\\\"\" % (id)\n+        diffcmd = \"git diff-tree --full-index -p \\\"%s\\\"\" % (id)\n         patchcmd = diffcmd + \" | git apply \"\n         tryPatchCmd = patchcmd + \"--check -\"\n         applyPatchCmd = patchcmd + \"--check --apply -\"\n-- \n1.7.9.5\n"},{"id":"239754","messageId":"20140426124307.GB4767@padd.com","threadId":"36494","inReplyTo":"20140425044618.GA7058@olive","subject":"Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2014-04-26T12:43:07Z","receivedAt":"2014-04-26T12:43:07Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"tolga.ceylan@gmail.com wrote on Thu, 24 Apr 2014 21:46 -0700:\n> When applying binary patches a full index is required. format-patch\n> already handles this, but diff-tree needs '--full-index' argument\n> to always output full index.\n> \n> Signed-off-by: Tolga Ceylan <tolga.ceylan@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 cdfa2df..4ee6739 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -1311,7 +1311,7 @@ class P4Submit(Command, P4UserMap):\n>              else:\n>                  die(\"unknown modifier %s for %s\" % (modifier, path))\n>  \n> -        diffcmd = \"git diff-tree -p \\\"%s\\\"\" % (id)\n> +        diffcmd = \"git diff-tree --full-index -p \\\"%s\\\"\" % (id)\n>          patchcmd = diffcmd + \" | git apply \"\n>          tryPatchCmd = patchcmd + \"--check -\"\n>          applyPatchCmd = patchcmd + \"--check --apply -\"\n> -- \n\nThis looks like a straightforward change, but can you give a\nbit more background on why a full index is required?  Do you\nmean that \"git apply\" will reject a patch with abbreviated\nblob object names?\n\n\t\t-- Pete\n"},{"id":"239782","messageId":"535C2138.3050400@gmail.com","threadId":"36494","inReplyTo":"20140426124307.GB4767@padd.com","subject":"Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches","fromName":"tolga ceylan","fromEmail":"tolga.ceylan@gmail.com","sentAt":"2014-04-26T21:12:24Z","receivedAt":"2014-04-26T21:12:24Z","isPatch":true,"sender":{"key":"tolga.ceylan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6537562?v=4"},"body":"Yes, when git-p4 runs git-apply to test the patch, this fails\ndue to abbreviated blob object names. I think git-apply requires\nfull object names for binary patches.\n\nOn 04/26/2014 05:43 AM, Pete Wyckoff wrote:\n> tolga.ceylan@gmail.com wrote on Thu, 24 Apr 2014 21:46 -0700:\n>> When applying binary patches a full index is required. format-patch\n>> already handles this, but diff-tree needs '--full-index' argument\n>> to always output full index.\n>>\n>> Signed-off-by: Tolga Ceylan <tolga.ceylan@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 cdfa2df..4ee6739 100755\n>> --- a/git-p4.py\n>> +++ b/git-p4.py\n>> @@ -1311,7 +1311,7 @@ class P4Submit(Command, P4UserMap):\n>>               else:\n>>                   die(\"unknown modifier %s for %s\" % (modifier, path))\n>>\n>> -        diffcmd = \"git diff-tree -p \\\"%s\\\"\" % (id)\n>> +        diffcmd = \"git diff-tree --full-index -p \\\"%s\\\"\" % (id)\n>>           patchcmd = diffcmd + \" | git apply \"\n>>           tryPatchCmd = patchcmd + \"--check -\"\n>>           applyPatchCmd = patchcmd + \"--check --apply -\"\n>> --\n>\n> This looks like a straightforward change, but can you give a\n> bit more background on why a full index is required?  Do you\n> mean that \"git apply\" will reject a patch with abbreviated\n> blob object names?\n>\n> \t\t-- Pete\n>\n"},{"id":"239783","messageId":"535C25B5.4050506@gmail.com","threadId":"36494","inReplyTo":"535C2138.3050400@gmail.com","subject":"Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches","fromName":"tolga ceylan","fromEmail":"tolga.ceylan@gmail.com","sentAt":"2014-04-26T21:31:33Z","receivedAt":"2014-04-26T21:31:33Z","isPatch":true,"sender":{"key":"tolga.ceylan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6537562?v=4"},"body":"\n\nOn 04/26/2014 02:12 PM, tolga ceylan wrote:\n> Yes, when git-p4 runs git-apply to test the patch, this fails\n> due to abbreviated blob object names. I think git-apply requires\n> full object names for binary patches.\n>\n>> This looks like a straightforward change, but can you give a\n>> bit more background on why a full index is required?  Do you\n>> mean that \"git apply\" will reject a patch with abbreviated\n>> blob object names?\n>>\n>>         -- Pete\n>>\n\nThis is the error message git-apply emits in this case:\n\nerror: cannot apply binary patch to '<filename>' without full index line\nerror: <filename>: patch does not apply\n\nCheers,\nTolga\n"},{"id":"240608","messageId":"53648169.7010307@gmail.com","threadId":"36494","inReplyTo":"535C25B5.4050506@gmail.com","subject":"Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches","fromName":"tolga ceylan","fromEmail":"tolga.ceylan@gmail.com","sentAt":"2014-05-03T05:40:57Z","receivedAt":"2014-05-03T05:40:57Z","isPatch":true,"sender":{"key":"tolga.ceylan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6537562?v=4"},"body":"\n>\n> This is the error message git-apply emits in this case:\n>\n> error: cannot apply binary patch to '<filename>' without full index line\n> error: <filename>: patch does not apply\n>\n> Cheers,\n> Tolga\n\nAny feedback is appreciated.\nCheers,\nTolga\n"},{"id":"240736","messageId":"20140505131456.GA21505@padd.com","threadId":"36494","inReplyTo":"53648169.7010307@gmail.com","subject":"Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2014-05-05T13:14:56Z","receivedAt":"2014-05-05T13:14:56Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"tolga.ceylan@gmail.com wrote on Fri, 02 May 2014 22:40 -0700:\n> \n> >\n> >This is the error message git-apply emits in this case:\n> >\n> >error: cannot apply binary patch to '<filename>' without full index line\n> >error: <filename>: patch does not apply\n> >\n> >Cheers,\n> >Tolga\n> \n> Any feedback is appreciated.\n\nSorry, travel delay.  This explanation is pretty\nstraight-forward, thanks.\n\nSuggest you include it in the commit message along with the\nother text you had, and resend to the list, cc me and junio.\nOh, and include an ack:\n\n    Acked-by: Pete Wyckoff <pw@padd.com>\n"}]}