git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git p4: Use git diff-tree instead of format-patch
@ 2013-11-21 15:19 Crestez Dan Leonard
  2013-11-21 19:47 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Crestez Dan Leonard @ 2013-11-21 15:19 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]


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(-)



[-- Attachment #2: 0001-git-p4-Use-git-diff-tree-instead-of-format-patch.patch --]
[-- Type: text/x-patch, Size: 524 bytes --]

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] git p4: Use git diff-tree instead of format-patch
  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
  2013-11-22 23:12   ` Pete Wyckoff
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2013-11-21 19:47 UTC (permalink / raw)
  To: Crestez Dan Leonard; +Cc: git, Pete Wyckoff

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] git p4: Use git diff-tree instead of format-patch
  2013-11-21 19:47 ` Junio C Hamano
@ 2013-11-22 23:12   ` Pete Wyckoff
  2013-11-22 23:35     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Pete Wyckoff @ 2013-11-22 23:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Crestez Dan Leonard, git

gitster@pobox.com wrote on Thu, 21 Nov 2013 11:47 -0800:
> 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...

This looks great, and passes all my tests.

Acked-by: Pete Wyckoff <pw@padd.com>

Thanks,

		-- Pete

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] git p4: Use git diff-tree instead of format-patch
  2013-11-22 23:12   ` Pete Wyckoff
@ 2013-11-22 23:35     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2013-11-22 23:35 UTC (permalink / raw)
  To: Pete Wyckoff; +Cc: Crestez Dan Leonard, git

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-22 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-11-22 23:12   ` Pete Wyckoff
2013-11-22 23:35     ` Junio C Hamano

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).