git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Hellmuth <hellmuth@ira.uka.de>
To: Jakub Narebski <jnareb@gmail.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	Junio C Hamano <gitster@pobox.com>,
	Scott Chacon <schacon@gmail.com>, Michael Nahas <mike@nahas.com>,
	git@vger.kernel.org
Subject: Re: Command-line interface thoughts
Date: Thu, 09 Jun 2011 13:55:30 +0200	[thread overview]
Message-ID: <4DF0B4B2.7080007@ira.uka.de> (raw)
In-Reply-To: <201106082056.38774.jnareb@gmail.com>

On 08.06.2011 20:56, Jakub Narebski wrote:
[...]
>>>      Because of explicit index (cache, staging area) one needs to know if
>>>      it is working area against index, or working area against HEAD.
>>>      Thinking about merge conflict case helps to remember; in such case
>>>      you want your changes against partially resolved merge.
          --------
>>
>> This is far from a straightforward reasoning that would pop up in
>> anyones mind. In truth, I can't follow that reasoning even now. In case
>> of a merge conflict the working area doesn't concern me at all, I would
>> want a diff between 'ours' and 'theirs'.
>
> What you want is irrelevant ;-)

No, because you used my wants in your reasoning above. Makes them highly 
relevant ;-)

> Because in the case of merge conflict
> entries in index is populated automatically, *your* changes are changes
> agains index.  So there.
>
> And what "git diff" would show in that case is --cc diff of file with
> merge markers against stages '1' and '2' in index, which is quite useful.
> Which is 3-way diff between 'ours' and 'theirs'.

Ah okay. This detail about the merge process never really registered 
with me. Which shows that your logic deduction what 'git diff' does is 
often not possible for the casual user

[...]
>> 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. 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.

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'.

[...]
>>> At in no place I _have_ to explain what is compared with what to explain
>>> when and what for to use "git diff", "git diff --cached" and "git diff
>>> HEAD".
>>
>> I'm sure every part of the user interface of gimp can be rationalized in
>> the same way by someone deeply involved in the concepts and the
>> structure of gimp, but still it is perceived as difficult by nearly
>> everyone else. You look at it from inside and it looks logical. Others
>> just don't have all the pieces to make that reasoning really work.
>
> What I wanted to say here that instead of teaching / trying to teach
> new people something like the following:
>
>    There is working area, index and current commit (HEAD).  To compare
>    workdir with index use this, to compare index with HEAD use that, to
>    compare workdir with HEAD use this one.

If they know working area, index and head, you don't have to tell them 
three times how to compare this with that, they just have to know they 
can compare any which way they want. In fact, the situation *now* is 
exactly what you describe, you have to tell everyone for any of the 3 
combinations the command to use because it is not obvious.

> we better do explaining higher level concepts
>
>    To examine your remaining changes, i.e. what you can "git stage",
>    use "git diff".  To examine staged changes, i.e. what you
>    "git stage"-d, use "git diff --staged"; that is what "git commit"
>    will create.  To compare working version with given older version,
>    use "git diff<revision>", in particular to compare with last version
>    use "git diff HEAD"; that is what "git commit --all" would create.

Do you realize that you are just enumerating all the possible 
combinations again, exactly what you wanted to avoid? Ok, unfair 
argument, you want to just make it clear how to remember the commands. 
But if I already need 3 emails from you to see the concept behind these 
commands (and lets assume my slow-wittedness is par for the course) many 
others will probably have the same problems. It may be a nice concept, 
but the relation to the user interface is only detectable by close 
examination.

Teaching concepts is good. But if git is only usable after having 
learned all those concepts, the entry barrier is much too big. With 
commands like 'git put' and an improved diff people can use git first, 
then learn the concepts while using git. Which is what most people have 
to do anyway if they encounter git at the work place for example.

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

Holger.

  reply	other threads:[~2011-06-09 11:54 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTikTWx7A64vN+hVZgL7cuiZ16Eobgg@mail.gmail.com>
2011-06-04 16:17 ` Command-line interface thoughts Michael Nahas
2011-06-04 21:49   ` Jakub Narebski
2011-06-05  1:00     ` Michael Nahas
2011-06-05 11:10       ` Jakub Narebski
2011-06-05 18:39         ` Scott Chacon
2011-06-05 23:37           ` Jakub Narebski
2011-06-06  6:16           ` Junio C Hamano
2011-06-06  7:34             ` Michael J Gruber
2011-06-06 11:45               ` Michael Nahas
2011-06-06 12:19               ` Jakub Narebski
2011-06-06 13:20                 ` Michael J Gruber
2011-06-08 13:10                   ` Jakub Narebski
2011-06-06 16:23                 ` Junio C Hamano
2011-06-06 16:40                   ` Drew Northup
2011-06-06 14:00               ` Junio C Hamano
2011-06-06 14:16                 ` Michael J Gruber
2011-06-06 16:14                   ` Junio C Hamano
2011-06-06 17:42                     ` Scott Chacon
2011-06-06 19:01                       ` Junio C Hamano
     [not found]                         ` <BANLkTi=yytzDrJLvVn_ZhJOiQs-rqvKi1w@mail.gmail.com>
2011-06-07  2:31                           ` Michael Nahas
2011-06-07  4:03                             ` Junio C Hamano
2011-06-07 11:04                               ` Michael Nahas
2011-06-07  6:11                     ` Michael J Gruber
2011-06-07 11:45                       ` Jonathan Nieder
2011-06-07 19:00                         ` Holger Hellmuth
2011-06-07 19:11                           ` Jonathan Nieder
2011-06-07 20:33                             ` Jakub Narebski
2011-06-08 13:04                               ` Holger Hellmuth
2011-06-08 18:56                                 ` Jakub Narebski
2011-06-09 11:55                                   ` Holger Hellmuth [this message]
2011-06-10 16:44                                     ` Jakub Narebski
2011-06-10 18:07                                       ` Holger Hellmuth
2011-06-10 18:35                                         ` Jakub Narebski
2011-06-10 22:45                                           ` Holger Hellmuth
2011-06-13  3:43                                             ` git diff --added (Re: Command-line interface thoughts) Jonathan Nieder
2011-06-13  4:11                                               ` Miles Bader
2011-06-13  4:46                                                 ` Miles Bader
2011-06-13  8:06                                                 ` Jonathan Nieder
2011-06-13 12:55                                                   ` Junio C Hamano
2011-06-13 12:28                                                 ` Junio C Hamano
2011-06-13 19:47                                                   ` Holger Hellmuth
2011-06-13 20:31                                                     ` Michael Nahas
2011-06-13 10:15                                             ` Command-line interface thoughts Jakub Narebski
2011-06-13 22:33                                               ` Holger Hellmuth
2011-06-14  4:21                                               ` Michael Haggerty
2011-06-14  7:51                                                 ` Jakub Narebski
2011-06-07 19:34                         ` René Scharfe
2011-06-07 19:38                           ` Jakub Narebski
2011-06-08 11:12                       ` Command-line interface thoughts (ad-hominem attacks) Jakub Narebski
2011-06-08 11:39                         ` Michael Nahas
2011-06-08 12:42                           ` Jakub Narebski
2011-06-08 14:15                             ` Michael Nahas
2011-06-08 15:05                           ` Jeff King
2011-06-08 18:57                             ` Michael Nahas
2011-06-09  0:43                               ` Jeff King
2011-06-09  1:56                                 ` Michael Nahas
2011-06-10 15:29                                   ` Jakub Narebski
2011-06-09  9:48                               ` Command-line interface thoughts Jakub Narebski
2011-06-09 11:44                                 ` Michael Nahas
2011-06-09 12:45                                   ` Jakub Narebski
2011-06-09 13:06                                     ` Jakub Narebski
2011-06-09  9:06             ` Michael Haggerty
2011-06-09 10:02               ` Andreas Ericsson
2011-06-09 13:30                 ` Thomas Rast
2011-06-09 16:18               ` Jeff King
2011-06-09 17:15                 ` Jay Soffian
2011-06-09 17:20                   ` Jeff King
2011-06-09 17:36                   ` Junio C Hamano
2011-06-09 18:20                     ` Jay Soffian
2011-06-09 19:40                       ` Junio C Hamano
2011-06-09 18:03                 ` Michael Haggerty
2011-06-09 18:38                   ` Junio C Hamano
2011-06-09 19:17                     ` Michael Haggerty
2011-06-09 20:04                     ` Jeff King
2011-06-09 21:37                       ` Michael Haggerty
2011-06-09 22:04                         ` Jakub Narebski
2011-06-09 23:02                           ` Michael Haggerty
2011-06-10 10:19                             ` Jakub Narebski
2011-06-10 11:06                               ` Michael Nahas
2011-06-10 12:20                                 ` Jakub Narebski
2011-06-09 22:21                         ` Jeff King
2011-06-09 22:27                         ` Michael Nahas
2011-06-09 22:38                           ` Jeff King
2011-06-09 22:55                             ` Jakub Narebski
2011-06-10  0:00                             ` Michael Nahas
2011-06-10  0:08                               ` Jeff King
2011-06-10 21:48                       ` Junio C Hamano
2011-06-10 22:08                         ` Junio C Hamano
2011-06-10 23:05                         ` Jakub Narebski
2011-06-12  6:06                         ` Michael Haggerty
2011-06-12 21:12                           ` Junio C Hamano
2011-06-12 13:30                         ` Michael Nahas
2011-06-12 21:29                           ` Junio C Hamano
2011-06-13  2:14                             ` Michael Nahas
2011-06-13 18:50                         ` Jeff King
2011-06-09 19:41                   ` Jeff King
2011-06-05 21:22         ` Paul Ebermann
2011-06-05 21:34   ` Paul Ebermann

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=4DF0B4B2.7080007@ira.uka.de \
    --to=hellmuth@ira.uka.de \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=mike@nahas.com \
    --cc=schacon@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).