git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Theodore Tso <tytso@mit.edu>, Andreas Ericsson <ae@op5.se>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <junkio@cox.net>, Nicolas Pitre <nico@cam.org>,
	git@vger.kernel.org
Subject: Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".
Date: Thu, 30 Nov 2006 10:09:29 -0800	[thread overview]
Message-ID: <87k61cu7qe.wl%cworth@cworth.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0611300903080.3513@woody.osdl.org>

[-- Attachment #1: Type: text/plain, Size: 4791 bytes --]

On Thu, 30 Nov 2006 09:13:52 -0800 (PST), Linus Torvalds wrote:
> On Thu, 30 Nov 2006, Theodore Tso wrote:
> >
> > But then why is the default for "git commit" to commit the index, if
> > the index is almost == HEAD?  And why is git-update-index given such
> > prominence in the documentation?
>
> The default is: commit everything that you ask for to be committed.
...
> It has NOTHING to do with the index per se.

OK. I'll try to not mention the "index" any more in any postings
here.

And can we agree that any time git spits out a message directing the
user to use update-index that that's a (minor) user-interface wart?

> 	"git commit" with no parameters simply DOES NOT DO ANYTHING YOU
> 	HAVEN'T ALREADY ASKED YOU TO DO.

I think the response that would come from the people that are confused
is:

	"But I told git I wanted to track this file when I said 'git
	add' long ago. Why is it making me tell it again."

As you mentioned, all systems have _some_ mechanism for keeping track
of the files to be committed, (and git's is only unique in having a
name and providing more functionality for direct manipulation and lots
of extra information in the case of a merge conflict).

But I think most every system out there _except_ git default to a
state of committing every file it "knows" about as it exists in the
working tree, and then allowing the user to restrict that behavior to
some subset of the files.

Git allows the same subsetting, and has behavior that is very similar
to these other systems when the user provides a list of files.

Git also provides a unique mode in that users can "stage" file state
to be committed later in spite of subsequent different changes being
made to the same files in the working tree that won't be
committed. Some git users love this functionality. But mentioning it
to new users does scare them off to some extent, ("Why would I _want_
to do that?", "What if that happens accidentally?").

And I think one thing that happens is that the current defaults
naturally lead users to hear about this "scary" functionality, even if
the presenter, (whether a human or printed documentation), isn't
trying to go that direction:

Presenter:	So use "git commit -a" here.

New user:	Why -a?

Presenter:	To tell git that you want to commit all files rather
		than having to list them all on the command line.

New user:	Why not just "git commit" for that then?

Presenter:	Because that's something else.

New user:	What's that?

Presenter: 	It lets you stage things---stuff you think is ready to
		commit, but when you want to delay that commit until
		after making other changes to the files that you don't
		want to commit.

New user:	What? Really? That's bizarre.

Presenter:	It can be useful in some situations. But for now,
		just use "commit -a" and it will do what you want.

And at this point the user either trusts me, accepts it, gives git a
try and falls in love, or the user gives up and uses something else.

I think the above accurately captures the essence of actual
conversations I've had with new new users. And I'd be glad to take
suggestions on how to improve what I say here. But it's that feeling
of "git is bizarre" that I'd like to reduce, and I'd like to improve
the success rate of the conversation, (though I think I've done pretty
well for people that trust me).

And note that the same kind of conversation happens when using git
directly with tutorials and man pages, but without a human
presenter. Only, there the conversation is much worse. First, it's
harder to pull off "just trust me and give it a try" in technical
documentation. Second, the documentation does not do a good job of
letting the user know when they're getting more technical information
than they need.

For example, there's "git status", (used by "git commit"), that
directs the user to "git update-index". Then there's the documentation
of git-commit that says "Updates the index file...and makes a commit
object."

And so far my best response to those problems is to short-cut them by
improving the defaults of git-commit, (the documentation should be
improved too, and I did submit a patch to get "update-index" out of
git-status output for example).

Anyway, I'm repeating myself on some of these details, but only
because some people still haven't seemed to grasp the real, new-user
confusion that arises here.

That's really what I'm trying to reduce with all the talk about
"commit all known files by default".

> 	"git commit" with no parameters simply DOES NOT DO ANYTHING YOU
> 	HAVEN'T ALREADY ASKED YOU TO DO.
>
> Repeat the above sentence again. IT JUST MAKES SENSE.

Yes. And it makes sense for the user to be able to say "unless I tell
you differently, I want to always commit the working-tree state of
<files> with every commit".

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-11-30 18:10 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27 21:31 [PATCH/RFC] "init-db" can really be just "init" Nicolas Pitre
2006-11-27 22:05 ` Junio C Hamano
2006-11-27 22:40   ` Hyphens and hiding core commands (was: "init-db" can really be just "init") Carl Worth
2006-11-27 23:59     ` Hyphens and hiding core commands Junio C Hamano
2006-11-28  0:23       ` Carl Worth
2006-11-28  0:42         ` Junio C Hamano
2006-11-28  1:35           ` Carl Worth
2006-11-28  2:18             ` Junio C Hamano
2006-11-28  5:40               ` Theodore Tso
2006-11-28  9:15                 ` Junio C Hamano
2006-11-29  7:14                   ` Michael S. Tsirkin
2006-11-28  6:59               ` [PATCH 0/2] Making "git commit" to mean "git commit -a" Junio C Hamano
2006-11-28 10:26                 ` Andy Whitcroft
2006-11-28 13:00                 ` Josef Weidendorfer
2006-11-28 13:23                   ` Jakub Narebski
2006-11-28 18:18                 ` Carl Worth
2006-11-29  3:06                   ` Junio C Hamano
2006-11-29  4:33                     ` Nicolas Pitre
2006-11-29  7:44                       ` Junio C Hamano
2006-11-29 18:08                         ` Nicolas Pitre
2006-11-29 18:18                           ` Jakub Narebski
2006-11-29 19:12                             ` Steven Grimm
2006-11-29 19:30                               ` Jakub Narebski
2006-11-29 18:53                           ` Junio C Hamano
2006-11-29 19:09                             ` Steven Grimm
2006-11-29 20:01                               ` Johannes Schindelin
2006-11-29 20:39                                 ` Junio C Hamano
2006-11-29 21:50                                   ` xdl_merge(), was " Johannes Schindelin
2006-11-30  5:24                                   ` Seth Falcon
2006-11-29 23:37                         ` Carl Worth
2006-11-29 23:53                           ` Johannes Schindelin
2006-11-30  1:03                           ` Junio C Hamano
2006-11-30  1:22                             ` Junio C Hamano
2006-11-30  1:58                               ` Steven Grimm
2006-11-30  2:04                                 ` Sam Vilain
2006-11-30  2:12                                 ` Junio C Hamano
2006-11-30  2:11                               ` Johannes Schindelin
2006-11-30  3:10                                 ` Linus Torvalds
2006-11-30 10:27                                   ` Johannes Schindelin
2006-11-30 11:09                                   ` Andreas Ericsson
2006-11-30 15:58                                     ` Linus Torvalds
2006-11-30 16:40                                       ` Theodore Tso
2006-11-30 17:13                                         ` Linus Torvalds
2006-11-30 17:37                                           ` Nicolas Pitre
2006-11-30 18:38                                             ` Carl Worth
2006-11-30 18:47                                               ` Jakub Narebski
2006-11-30 19:04                                                 ` Carl Worth
2006-12-01  8:44                                                   ` Andreas Ericsson
2006-12-01  9:31                                                     ` Han-Wen Nienhuys
2006-11-30 18:51                                               ` Carl Worth
2006-11-30 19:55                                                 ` Linus Torvalds
2006-11-30 20:47                                                   ` Nicolas Pitre
2006-11-30 21:03                                                     ` Linus Torvalds
2006-11-30 21:16                                                       ` Jakub Narebski
2006-11-30 21:37                                                         ` Carl Worth
2006-11-30 21:41                                                           ` Michael K. Edwards
2006-11-30 21:50                                                             ` Carl Worth
2006-11-30 21:58                                                               ` Jakub Narebski
2006-11-30 22:26                                                                 ` Johannes Schindelin
2006-11-30 22:07                                                           ` Josef Weidendorfer
2006-11-30 22:25                                                           ` Johannes Schindelin
2006-11-30 22:37                                                             ` Nicolas Pitre
2006-11-30 22:31                                                           ` Nicolas Pitre
2006-11-30 22:47                                                           ` Junio C Hamano
2006-12-01  8:34                                                       ` Andy Parkins
2006-12-01 23:33                                                         ` Alan Chandler
2006-11-30 21:19                                                     ` Junio C Hamano
2006-11-30 22:21                                                       ` Nicolas Pitre
2006-11-30 23:02                                                         ` Junio C Hamano
2006-11-30 23:40                                                           ` Linus Torvalds
2006-12-01  0:13                                                             ` Carl Worth
2006-12-01  0:21                                                               ` Linus Torvalds
2006-12-01  1:10                                                                 ` Carl Worth
2006-12-01  1:32                                                                   ` Linus Torvalds
2006-12-01  2:08                                                                     ` Carl Worth
2006-12-01  2:44                                                                       ` Linus Torvalds
2006-12-01  3:40                                                                         ` Carl Worth
2006-12-01  3:52                                                                         ` Michael K. Edwards
2006-12-01  0:24                                                             ` Junio C Hamano
     [not found]                                                           ` <Pine.LNX.4. 64.0611301520370.3513@woody.osdl.org>
2006-12-01  0:06                                                             ` Jakub Narebski
2006-12-01  1:20                                                           ` Nicolas Pitre
2006-12-01  8:59                                                         ` Andreas Ericsson
2006-12-01 23:36                                                           ` Alan Chandler
     [not found]                                                   ` <7vac28h898.fsf@assigned-by-dhcp.cox.net>
2006-11-30 22:46                                                     ` Nicolas Pitre
2006-11-30 22:55                                                     ` Johannes Schindelin
2006-11-30 21:33                                                 ` Robert Shearman
2006-11-30 21:41                                                   ` Jakub Narebski
2006-12-01 18:27                                                     ` Shawn Pearce
2006-12-02  7:48                                                     ` Marco Costalba
2006-11-30 18:09                                           ` Carl Worth [this message]
2006-11-30 18:33                                             ` Linus Torvalds
2006-11-30  0:52                     ` Daniel Barkalow
2006-11-30 12:23                 ` Salikh Zakirov
2006-11-30 13:16                   ` Jakub Narebski
2006-11-30 15:15                     ` Seth Falcon
2006-11-30 15:50                       ` Nguyen Thai Ngoc Duy
2006-11-30 16:03                         ` Seth Falcon
2006-11-30 16:05                       ` Jakub Narebski
2006-11-30 17:13                   ` Andy Whitcroft
2006-11-28  7:00               ` [PATCH 1/2] git-commit: prepare to make '-a' behaviour the default Junio C Hamano
2006-11-28  7:00               ` [PATCH 2/2] git-commit: make '-a' " Junio C Hamano
2006-11-28  9:09                 ` Jakub Narebski
2006-11-27 23:36   ` [PATCH/RFC] "init-db" can really be just "init" Johannes Schindelin
2006-11-28 10:45   ` Han-Wen Nienhuys

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=87k61cu7qe.wl%cworth@cworth.org \
    --to=cworth@cworth.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=nico@cam.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    /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).