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

[PATCH] git p4: Use git diff-tree instead of format-patch

From
CLCrestez Dan Leonard <cdleonard@gmail.com>
Date
Nov 21, 2013, 15:19 UTC
Message-ID
<528E2467.4030900@gmail.com>

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 -"
Next: Junio C Hamano
Message 1 of 4 in “git p4: Use git diff-tree instead of format-patch”
  1. git p4: Use git diff-tree instead of format-patchCrestez Dan Leonard, Nov 21, 2013
  2. Junio C HamanoNov 21, 2013
  3. Pete WyckoffNov 22, 2013
  4. Junio C HamanoNov 22, 2013

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.