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

2012-09-17 Thread perryh
Mischa POSLAWSKY g...@shiar.nl wrote:

 ... I would argue against diff options creating non-standard patches.

Seems to me it might depend on what one means by non-standard.

I can envision cases in which increasing the number of context lines
would result in the patch being more robust WRT applying correctly
to a recipient's version that might be a bit different than the one
against which it was created.

OTOH one most likely does not want to create a patch with -b unless
the apply tool also supports such and there is a way to communicate
to the apply tool that -b was used in creating the patch.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2012-09-16 Thread Mischa POSLAWSKY
 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 g...@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
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2012-09-16 Thread Junio C Hamano
Mischa POSLAWSKY g...@shiar.nl writes:

 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 g...@shiar.nl
 ---

Not all projects expect to see a/  b/ prefix and these are
configurable for a reason.  Robbing the choice that has been
supported for quite a long time from them is an unacceptable
regression.

Why did you think this may be a good idea in the first place?

Perhaps you had configured your diff.noprefix in a wrong
configuration file?  This is primarily per-project choice, and your
clone of git.git should not have diff.noprefix set, neither your
$HOME/.gitconfig unless you always work on projects that want
diff.noprefix.

  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;
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html