Re: [PATCH] diff-* --with-raw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Petr Baudis <pasky@xxxxxxx> writes:

> git-diff-* output is by default the raw format, and with the --with-raw
> option you tell it to furthermore include the raw format... sounds
> wrong, doesn't it? ;-) I'd call it --patch-with-raw or -P.

Since --raw-with-raw would be oximoron, I would say --with-raw
would naturally mean --patch-with-raw, but that's fine.

> Also, it would be nice to handle the -c case as well. Not strictly
> necessary for cg-log right now, but other cg-Xfollowrenames users might
> want to have that for merges... (Potentially, this might break renames
> detection but the case is really obscure.)

This would cover that request, comes on top of the previous one.

--

diff --git a/combine-diff.c b/combine-diff.c
index eb0d757..748dc30 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -832,6 +832,7 @@ const char *diff_tree_combined_merge(con
 
 	diffopts = *opt;
 	diffopts.output_format = DIFF_FORMAT_NO_OUTPUT;
+	diffopts.with_raw = 0;
 	diffopts.recursive = 1;
 
 	/* count parents */
@@ -858,6 +859,15 @@ const char *diff_tree_combined_merge(con
 			num_paths++;
 	}
 	if (num_paths) {
+		if (opt->with_raw) {
+			opt->output_format = DIFF_FORMAT_RAW;
+			for (p = paths; p; p = p->next) {
+				if (show_combined_diff(p, num_parent, dense,
+						       header, opt))
+					header = NULL;
+			}
+			opt->output_format = DIFF_FORMAT_PATCH;
+		}
 		for (p = paths; p; p = p->next) {
 			if (show_combined_diff(p, num_parent, dense,
 					       header, opt))

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]