threads / discuss / 3261

"git diff a..b" broken

Subject: "git diff a..b" broken

## tl;dr

3 messages between Feb 7, 2006 and Feb 7, 2006.

replies: 2people: 2as markdown or json

Linus Torvalds· Feb 7, 2006, 18:23 UTC · lore
There's a funny breakage from the recent "--cc" changes.
If you do 
	git-diff-tree --cc version version2

and "version2" is a merge, it will do something really strange. I haven't figured out quite _what_ it does, but it's definitely the wrong thing.

Just a heads up. I'll try to track down what the breakage is.
		Linus
Linus Torvalds· Feb 7, 2006, 18:26 UTC · re: Linus Torvalds · lore

Re: "git diff a..b" broken

On Tue, 7 Feb 2006, Linus Torvalds wrote:
> 
> Just a heads up. I'll try to track down what the breakage is.
Ahh. Very simple.
The "--cc" implies "-p", but without the recursive part.
		Linus
----
diff --git a/diff-tree.c b/diff-tree.c
index f3280a1..7148323 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -284,14 +284,15 @@ int main(int argc, const char **argv)
 		}
 		usage(diff_tree_usage);
 	}
-	if (diff_options.output_format == DIFF_FORMAT_PATCH)
-		diff_options.recursive = 1;
 
 	if (combine_merges) {
 		diff_options.output_format = DIFF_FORMAT_PATCH;
 		ignore_merges = 0;
 	}
 
+	if (diff_options.output_format == DIFF_FORMAT_PATCH)
+		diff_options.recursive = 1;
+
 	diff_tree_setup_paths(get_pathspec(prefix, argv));
 	diff_setup_done(&diff_options);
 

← back to recent threads