All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] diff-* --with-raw
Date: Mon, 10 Apr 2006 17:35:11 -0700	[thread overview]
Message-ID: <7vr7456jb4.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060411002311.GW27689@pasky.or.cz> (Petr Baudis's message of "Tue, 11 Apr 2006 02:23:11 +0200")

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))

  reply	other threads:[~2006-04-11  0:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-11  0:00 [PATCH] diff-* --with-raw Junio C Hamano
2006-04-11  0:06 ` Junio C Hamano
2006-04-11  0:23   ` Petr Baudis
2006-04-11  0:35     ` Junio C Hamano [this message]
2006-04-11 11:22       ` [PATCH] Rename --with-raw to --patch-with-raw and document it Petr Baudis
2006-04-11 11:30       ` [PATCH] Separate the raw diff and patch with a newline Petr Baudis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr7456jb4.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.