git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow combined diff to ignore white-spaces
@ 2013-03-02 15:04 Antoine Pelisse
  2013-03-03  7:45 ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Antoine Pelisse @ 2013-03-02 15:04 UTC (permalink / raw)
  To: git; +Cc: Antoine Pelisse

Currently, it's not possible to use the space-ignoring options (-b, -w,
--ignore-space-at-eol) with combined diff. It makes it pretty impossible
to read a merge between a branch that changed all tabs to spaces, and a
branch with functional changes.

Pass diff flags to diff engine, so that combined diff behaves as normal
diff does with spaces.

It also means that a conflict-less merge done using a ignore-* strategy
option will not show any conflict if shown in combined-diff using the
same option.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
That should be reviewed carefully as I'm not exactly sure that does make
sense with the way combined-diff works.
Still it seems natural to me to be able to remove the space in combined
diff as we do with normal diff. Especially as I unfortunately have to
deal with many space + feature merges that are very hard to analyze/handle
if space differences can't be hidden.

Cheers,
Antoine

 combine-diff.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/combine-diff.c b/combine-diff.c
index 35d41cd..7ca0a72 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -215,7 +215,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
 			 struct sline *sline, unsigned int cnt, int n,
 			 int num_parent, int result_deleted,
 			 struct userdiff_driver *textconv,
-			 const char *path)
+			 const char *path, long flags)
 {
 	unsigned int p_lno, lno;
 	unsigned long nmask = (1UL << n);
@@ -231,7 +231,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
 	parent_file.ptr = grab_blob(parent, mode, &sz, textconv, path);
 	parent_file.size = sz;
 	memset(&xpp, 0, sizeof(xpp));
-	xpp.flags = 0;
+	xpp.flags = flags;
 	memset(&xecfg, 0, sizeof(xecfg));
 	memset(&state, 0, sizeof(state));
 	state.nmask = nmask;
@@ -962,7 +962,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
 				     elem->parent[i].mode,
 				     &result_file, sline,
 				     cnt, i, num_parent, result_deleted,
-				     textconv, elem->path);
+				     textconv, elem->path, opt->xdl_opts);
 	}

 	show_hunks = make_hunks(sline, cnt, num_parent, dense);
--
1.7.9.5

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

end of thread, other threads:[~2013-03-14 21:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-02 15:04 [PATCH] Allow combined diff to ignore white-spaces Antoine Pelisse
2013-03-03  7:45 ` Junio C Hamano
2013-03-04 18:17   ` Antoine Pelisse
2013-03-04 18:36     ` Junio C Hamano
2013-03-04 18:50       ` Antoine Pelisse
2013-03-13 21:21   ` Antoine Pelisse
2013-03-13 23:42     ` Junio C Hamano
2013-03-13 23:53     ` Junio C Hamano
2013-03-14  7:08     ` Johannes Sixt
2013-03-14 15:31       ` Junio C Hamano
2013-03-14 15:51         ` Antoine Pelisse
2013-03-14 21:03         ` [PATCH v3] " Antoine Pelisse
2013-03-14 21:43           ` 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).