On Thu, 9 Jun 2011, Holger Hellmuth wrote:
On 08.06.2011 20:56, Jakub Narebski wrote:
[...]
quoted
quoted
But I can't make it explicit which two targets I want to compare with
'git diff'.
For me it looks XY problem; instead of wanting to compare two explicit
targets, you should specify what you want to see ;-).
Then don't call the command 'diff' (... I proclaim in the knowledge that
that isn't possible). 'diff' is the short form of 'difference' which
means literally a comparison between *two* things.
Blame CVS (I think) on that. It introduced no arguments "cvs diff" to
get current changes, and other version control systems picked this
convention up, including Git.
"diff" is 'are there any differences', or 'are there any changes'.
Implicit rules (targets) are very useful.
If someone wants to
see something he would pick the words 'show' or 'list'. So user
expectation is different from what you want diff to be.
There is always "git status"...
Also there are no good words for what someone wants to see in this case.
At least I would assume the git project would have found them if they
existed. '--cached' is definitely not one of them. But we have fitting
and widely known names for the targets, i.e 'working tree', 'index' and
'head'.
"I want to see if there are any remiaining changes", "I want to see what
'git commit' would bring", "I want to see what 'git commit -a' would bring".
Neither of those is about targets for diff.
[...]
quoted
The "git diff NEXT WTREE" looks like training wheels to me. And like
training wheels they could become obstacles and not help to learning
git. Neverthemind they can snag on sharp corners^W corner-cases. ;-)))
If your goal is that anyone who uses git is a git expert, they may be a
hindrance (as are all the porcelain commands really). If you also want
to make git friendly to people who will never get past intermediate or
beginner stage or will only use a small part of git or use git seldomly,
training wheels are good.
Those "training wheels" are useless for beginner, and might be not very
useful to middle expert user either, depending on corner cases.
--
Jakub Narebski
Poland