From: Junio C Hamano Date: Tue, 26 Apr 2005 23:05:46 GMT Subject: Re: [PATCH] Add -r flag to show-diff for diff-cache/diff-tree like output. Message-ID: <7vd5shm94l.fsf@assigned-by-dhcp.cox.net> In-Reply-To: >>>>> "LT" == Linus Torvalds writes: LT> Why not just make this the default? Who really cares about LT> show-diff? Me, to care enough about it to send patches in ;-). LT> So why not just make "rational" the standard format, and then make LT> "diff-tree-helper" warn about unmerged ("U") files? LT> As far as I can tell, that is really what _everybody_ wants. I do not think of a good reason to forbid people from getting a patch out of core GIT without going through the wrapper layer, and the code is already there. That said, I agree that scripts usually do not use patch generating form. I checked Cogito before doing the patch to make sure it is not affected by this, and my JIT core tools do not use it either. I think making the diff-tree/cache compatible output default would be fine. The current diff-producing behaviour can be made into an option (yes, I want to keep it). LT> And calling "-r" "rational", when it means "recursive" for LT> diff-tree and diff-cache doesn't sound rational to me. Well, the truth is that -r does not stand for anything. It just is there to match useless -r to diff-cache (the change you made to it to accept the same command line parameters -r (and optionally -z) people would always give diff-tree. You can call it recursive if you want. How about me doing the following and resubmitting? - Make this diff-tree/cache compatible output the default. - Take but ignore -r flag like diff-cache. - Add U warning to diff-tree-helper. - Add -p flag (patch) and have it cause the patch generating behaviour. Later I'll add -p flag to diff-cache and diff-tree, so the usage of these three commands match. That is: show-diff -r (useless) -z | diff-tree-helper -z diff-cache -r (useless) -z tree | diff-tree-helper -z diff-tree -r -z tree tree | diff-tree-helper -z show-diff -p [-r (useless)] diff-cache -p [-r (useless)] diff-tree -p [-r] With the GIT_EXTERNAL_DIFF envioronment variable, I suspect that wrapper scripts do not have to use the diff-tree-helper but directly use the -p form; but that will come later. Thoughts?