Re: [PATCH] diff-* --with-raw
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 11, 2006, 00:35 UTC
- Message-ID
- <7vr7456jb4.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20060411002311.GW27689@pasky.or.cz>
Petr Baudis <pasky@suse.cz> 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))