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: Wed, 08 Jun 2011 15:04:56 +0200	[thread overview]
Message-ID: <4DEF7378.20307@ira.uka.de> (raw)
In-Reply-To: <201106072233.28244.jnareb@gmail.com>

On 07.06.2011 22:33, Jakub Narebski wrote:
> To reiterate; perhaps it is not stated clearly in documentation:
 >
> 1. "git diff" is about examining _your_ changes.  This short form is the
>     same in every SCM.

you are right, more explicit mention in the docs would help about this.

But other SCMs don't have the additional target 'index'. Much easier to 
reason there. Also, wouldn't Joe User then conclude that 'git diff' must 
be comparing working area against HEAD ?

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

Since perl has been brought up as example of this DWIM philosophy: In 
perl commands have their defaults, but you always can specify exactly 
what you want if you are not sure or want to make it explicit. You can 
use 'chomp' or you can use 'chomp $_'. But I can't make it explicit 
which two targets I want to compare with 'git diff'.

>     Also advanced users can use index to hide fully cooked changes from
>     having to browse during review.
>
>     Novice users which do not use index (and use "git commit -a") would
>     never notice the difference, if not for the complication of newly
>     added files: in other SCM you would see on "<scm>  diff" creation
>     diff (well, there is "git add -N").  Same with removal if one uses
>     "git rm" and not simply "rm".

> 2. "git diff --cached" is about cached (staged) changes, therefore
>     it is index against HEAD.

We use three words to talk about the index: cache, stage, index. So 
apart from having an additional target for diff that target also is 
diffused by three words. Sure, index is the real designation and cached 
and staged are used as verbs, but that is just one more confusing bit. 
Also 'cache' in computer science is a transparent buffer to access data 
faster (wikipedia definition). Not what I would think of the index.

Probably there are good reasons to not use "git diff --index" and 
probably they have been discussed a few times, but it doesn't make using 
diff easier. But that's a side issue.

If someone sees 'git diff --cached' he might know one target, the index. 
But how does he get the other? By reasoning that 'git diff' alone is 
already index against working area? But for that he would have first to 
conclude that 'git diff' is not working area against HEAD (as it is in 
other SCMs), see above.

> 3. "git diff<commit>" in general, and "git diff HEAD" in particular,
>     is about your changes (worktree), compared to given commit.
>
> 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.

Holger.

  reply	other threads:[~2011-06-08 13:04 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 [this message]
2011-06-08 18:56                                 ` Jakub Narebski
2011-06-09 11:55                                   ` Holger Hellmuth
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=4DEF7378.20307@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).