Re: Git produces Unidiff - Does it really?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jan Engelhardt
Date: Monday, May 25, 2009 - 2:48 am

On Monday 2009-05-25 05:27, Junio C Hamano wrote:

Here is a random patch; not that I am fond of it, but it
speaks in code at least.
Tear it apar! :)


parent 9619ff14159ab3401636b9883a715b0f20b051df (v1.6.3.1-152-g9619ff1)
commit 9d73395d1c08d2fc4e1b740c2d37d8daed7cb3e6
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Mon May 25 11:40:34 2009 +0200

diff: produce TSVN-acceptable diff

Once TortoiseSVNMerge sees a \t after the filename in a --- line,
it accepts a patch. (Not that t
So let's produce patches with said \t, and a $ so the \t does not
get chopped off by incompetent tools or overlooked otherwise.
---
 diff.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/diff.c b/diff.c
index f06876b..55cb974 100644
--- a/diff.c
+++ b/diff.c
@@ -324,7 +324,7 @@ static void emit_rewrite_diff(const char *name_a,
 	lc_a = count_lines(data_one, size_one);
 	lc_b = count_lines(data_two, size_two);
 	fprintf(o->file,
-		"%s--- %s%s%s\n%s+++ %s%s%s\n%s@@ -",
+		"%s--- %s%s%s\t$\n%s+++ %s%s%s\n%s@@ -",
 		metainfo, a_name.buf, name_a_tab, reset,
 		metainfo, b_name.buf, name_b_tab, reset, fraginfo);
 	print_line_count(o->file, lc_a);
@@ -637,7 +637,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
 		name_a_tab = strchr(ecbdata->label_path[0], ' ') ? "\t" : "";
 		name_b_tab = strchr(ecbdata->label_path[1], ' ') ? "\t" : "";
 
-		fprintf(ecbdata->file, "%s--- %s%s%s\n",
+		fprintf(ecbdata->file, "%s--- %s%s%s\t$\n",
 			meta, ecbdata->label_path[0], reset, name_a_tab);
 		fprintf(ecbdata->file, "%s+++ %s%s%s\n",
 			meta, ecbdata->label_path[1], reset, name_b_tab);
-- 
# Created with git-export-patch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Git produces Unidiff - Does it really?, Jan Engelhardt, (Sun May 24, 4:15 pm)
Re: Git produces Unidiff - Does it really?, Junio C Hamano, (Sun May 24, 8:27 pm)
Re: Git produces Unidiff - Does it really?, Jan Engelhardt, (Mon May 25, 2:48 am)