git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches

From
tolga ceylan <tolga.ceylan@gmail.com>
Date
Apr 26, 2014, 21:12 UTC
Message-ID
<535C2138.3050400@gmail.com>
In-Reply-To
<20140426124307.GB4767@padd.com>

Yes, when git-p4 runs git-apply to test the patch, this fails due to abbreviated blob object names. I think git-apply requires full object names for binary patches.

On 04/26/2014 05:43 AM, Pete Wyckoff wrote:
Show 32 quoted lines
> tolga.ceylan@gmail.com wrote on Thu, 24 Apr 2014 21:46 -0700:
>> When applying binary patches a full index is required. format-patch
>> already handles this, but diff-tree needs '--full-index' argument
>> to always output full index.
>>
>> Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
>> ---
>>   git-p4.py |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/git-p4.py b/git-p4.py
>> index cdfa2df..4ee6739 100755
>> --- a/git-p4.py
>> +++ b/git-p4.py
>> @@ -1311,7 +1311,7 @@ class P4Submit(Command, P4UserMap):
>>               else:
>>                   die("unknown modifier %s for %s" % (modifier, path))
>>
>> -        diffcmd = "git diff-tree -p \"%s\"" % (id)
>> +        diffcmd = "git diff-tree --full-index -p \"%s\"" % (id)
>>           patchcmd = diffcmd + " | git apply "
>>           tryPatchCmd = patchcmd + "--check -"
>>           applyPatchCmd = patchcmd + "--check --apply -"
>> --
>
> This looks like a straightforward change, but can you give a
> bit more background on why a full index is required?  Do you
> mean that "git apply" will reject a patch with abbreviated
> blob object names?
>
> 		-- Pete
>
Previous: Pete WyckoffNext: tolga ceylan
Message 3 of 6 in “git-p4: format-patch to diff-tree change breaks binary patches”
  1. git-p4: format-patch to diff-tree change breaks binary patchesTolga Ceylan, Apr 25, 2014
  2. Pete WyckoffApr 26, 2014
  3. tolga ceylanApr 26, 2014
  4. tolga ceylanApr 26, 2014
  5. tolga ceylanMay 3, 2014
  6. Pete WyckoffMay 5, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.