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

Re: [PATCH] git-jump: ignore (custom) prefix in diff mode

From
MPMischa POSLAWSKY <git@shiar.nl>
Date
Sep 17, 2012, 03:01 UTC
Message-ID
<20120917030143.GA19986@pearl.mediadesign.nl>
In-Reply-To
<1347844915-4130-1-git-send-email-git@shiar.nl>
> diff --git contrib/git-jump/git-jump contrib/git-jump/git-jump
> index a33674e..dc90cd6 100755
> --- contrib/git-jump/git-jump
> +++ contrib/git-jump/git-jump

Apparently diff.noprefix also applies to git format-patch. Even though git am does explicitly support -p0, I would argue against diff options creating non-standard patches.

-- >8 --
Subject: [PATCH/RFC] format-patch: force default file prefixes in diff

Override user configuration (eg. diff.noprefix) in patches intended for external consumption to match the default prefixes expected by git-am.

Signed-off-by: Mischa POSLAWSKY <git@shiar.nl>
---
 builtin/log.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/builtin/log.c b/builtin/log.c
index dff7921..91ded25 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1131,6 +1131,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	rev.diff = 1;
 	rev.max_parents = 1;
 	DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
+	rev.diffopt.a_prefix = "a/";
+	rev.diffopt.b_prefix = "b/";
 	rev.subject_prefix = fmt_patch_subject_prefix;
 	memset(&s_r_opt, 0, sizeof(s_r_opt));
 	s_r_opt.def = "HEAD";
-- 
1.7.12.166.ga54f379
Previous: Mischa POSLAWSKYNext: Junio C Hamano
Message 2 of 10 in “git-jump: ignore (custom) prefix in diff mode”
  1. git-jump: ignore (custom) prefix in diff modeMischa POSLAWSKY, Sep 17, 2012
  2. Mischa POSLAWSKYSep 17, 2012
  3. Junio C HamanoSep 17, 2012
  4. Mischa POSLAWSKYSep 18, 2012
  5. Junio C HamanoSep 18, 2012
  6. Bert WesargSep 18, 2012
  7. perryh@pluto.rain.comSep 17, 2012
  8. Junio C HamanoSep 17, 2012
  9. Jeff KingSep 17, 2012
  10. Junio C HamanoSep 17, 2012

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.