Subject: Re: Command-line interface thoughts

From: Jakub Narebski <[email-masked]>
Date: Mon, 13 Jun 2011 12:15:22 +0200

On Sat, 11 June 2011, Holger Hellmuth wrote:
> Am 10.06.2011 20:35, schrieb Jakub Narebski:
>> Dnia piątek 10. czerwca 2011 20:07, Holger Hellmuth napisał:
>>> On 10.06.2011 18:44, Jakub Narebski wrote:
>>>> On Thu, 9 Jun 2011, Holger Hellmuth wrote:

>>>>> 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 remaining 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.
>>>
>>> Are you proposing a command "git 
>>> --I-want-to-see-if-there-are-any-remaining-changes" ? ;-). I was looking 
>>> for short command or parameter names that are easy to remember, not for 
>>> definitions of the output of cryptic commands.
>>>
>>> But lets see. If I didn't know much git, where would I look for the 
>>> right command for your three needs? Where would I expect the solution? 
>>> (note I'm not proposing any of these commands)
>>>
>>> "I want to see if there are any remaining changes"?
>>> git status
>>> git status --full
>>> git status --detailed
>> 
>> "Any differences"?
>> 
>> git diff
> 
> But difference to what --> User checks man page, again.

User's changes.  User doesn't need to know what are those two places
called.
 
>> 
>> 
>> "I want to see what I staged"
>> 
>> git diff --staged
>> 
> 
> User never heard of 'staged'. He asks instead "I want to see what I
> added" --> git diff --added --> Error Message --> User checks man page,
> again

User uses "git stage <file>", so he/she uses "git diff --staged".
 
[...]
>>> git diff WTREE INDEX
>>           ^^^^^^^^^^^ --- reverse to "git diff"
>> 
>> In this direction it is surely suprising... you see, how again and again
>> having to explicitely state what to compare with which leads to mistakes
>> such like this one, and the one in few mails earlier.
> 
> I'm a sloopy person as you have noticed. Also very forgetful. I usually
> don't bother with the order of 'diff' parameters when I can get the
> direction from the diff output.

For other people getting the reverse of changes can be certainly
suprising (I though I added this, not deleted...).  When you specify
endpoints manually, there is a chance to get them in wrong direction.
Especially that there is NEXT WTREE but HEAD NEXT.

> Small things like 'git unadd', Jeff Kings 'git put' and git diff with
> targets probably would help this casual/intermediate/advanced user (take
> your pick).

I agree with 'git unadd'.  Jeff Kings 'git put' and git diff targets have
the problems that need to be fully solved before considering for inclusion.

BTW. there is code for 'git put'.  Where is code for git diff targets?

-- 
Jakub Narebski
Poland