public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Crestez Dan Leonard <cdleonard@gmail•com>
Cc: git@vger•kernel.org, Pete Wyckoff <pw@padd•com>
Subject: Re: [PATCH] git p4: Use git diff-tree instead of format-patch
Date: Thu, 21 Nov 2013 11:47:57 -0800	[thread overview]
Message-ID: <xmqqa9gx4jv6.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <528E2467.4030900@gmail.com> (Crestez Dan Leonard's message of "Thu, 21 Nov 2013 17:19:03 +0200")

Crestez Dan Leonard <cdleonard@gmail•com> writes:

> 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".
>
> Signed-off-by: Crestez Dan Leonard <cdleonard@gmail•com>
> ---
>  git-p4.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index 31e71ff..fe988ce 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):
>              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 -"

I do not do p4 myself, but from a cursory reading it looks like the
right thing to do.  Thanks.

The output of "git shortlog --no-merges --since=1.year git-p4.py"
tells me that Pete should be the person much more familiar with the
code than myself, so I'll Cc him just in case...

  reply	other threads:[~2013-11-21 19:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 15:19 [PATCH] git p4: Use git diff-tree instead of format-patch Crestez Dan Leonard
2013-11-21 19:47 ` Junio C Hamano [this message]
2013-11-22 23:12   ` Pete Wyckoff
2013-11-22 23:35     ` Junio C Hamano

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=xmqqa9gx4jv6.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=cdleonard@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pw@padd$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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