git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tolga Ceylan <tolga.ceylan@gmail.com>
Cc: git@vger.kernel.org, cdleonard@gmail.com, pw@padd.com
Subject: Re: [PATCH] git-p4: format-patch to diff-tree change breaks binary patches
Date: Wed, 07 May 2014 10:27:14 -0700	[thread overview]
Message-ID: <xmqqtx91bitp.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140507054854.GA3571@olive> (Tolga Ceylan's message of "Tue, 6 May 2014 22:48:54 -0700")

Tolga Ceylan <tolga.ceylan@gmail.com> writes:

> 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. When git-p4 runs git-apply to test
> the patch, git-apply rejects the patch due to abbreviated blob
> object names. This is the error message git-apply emits in this
> case:
>
> error: cannot apply binary patch to '<filename>' without full index line
> error: <filename>: patch does not apply
>
> Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
> Acked-by: Pete Wyckoff <pw@padd.com>
> ---

Because the original breakage was already in 1.9, not a regression
between 1.9 and master, as the matter of principle our default is to
defer until 2.0 final to avoid risking unintended additional
breakages elsewhere.  But this fix is an obviously correct and
trivial single liner that were eyeballed by more than one person,
and that affects only three calls to os.system(), and its
correctness can be seen even without knowing p4 at all by somebody
like me ;-)

So let's queue it for 2.0.

Thanks.

>  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 -"

  reply	other threads:[~2014-05-07 17:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07  5:48 [PATCH] git-p4: format-patch to diff-tree change breaks binary patches Tolga Ceylan
2014-05-07 17:27 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-04-25  4:46 Tolga Ceylan
2014-04-26 12:43 ` Pete Wyckoff
2014-04-26 21:12   ` tolga ceylan
2014-04-26 21:31     ` tolga ceylan
2014-05-03  5:40       ` tolga ceylan
2014-05-05 13:14         ` Pete Wyckoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtx91bitp.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=cdleonard@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pw@padd.com \
    --cc=tolga.ceylan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).