git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mischa POSLAWSKY <git@shiar.nl>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Re: [PATCH] git-jump: ignore (custom) prefix in diff mode
Date: Mon, 17 Sep 2012 05:01:43 +0200	[thread overview]
Message-ID: <20120917030143.GA19986@pearl.mediadesign.nl> (raw)
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

  reply	other threads:[~2012-09-17  3:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17  1:21 [PATCH] git-jump: ignore (custom) prefix in diff mode Mischa POSLAWSKY
2012-09-17  3:01 ` Mischa POSLAWSKY [this message]
2012-09-17  5:22   ` Junio C Hamano
2012-09-18  2:52     ` Mischa POSLAWSKY
2012-09-18  3:57       ` Junio C Hamano
2012-09-18  9:00       ` Bert Wesarg
2012-09-17  6:03   ` perryh
2012-09-17  5:24 ` Junio C Hamano
2012-09-17 17:39   ` Jeff King
2012-09-17 19:48     ` 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=20120917030143.GA19986@pearl.mediadesign.nl \
    --to=git@shiar.nl \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).