X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.176.0/21 X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 From: Carl Worth Subject: Re: Hyphens and hiding core commands Date: Mon, 27 Nov 2006 17:35:16 -0800 Message-ID: <878xhwwdyj.wl%cworth@cworth.org> References: <7vmz6cfsuw.fsf@assigned-by-dhcp.cox.net> <87bqmswm1e.wl%cworth@cworth.org> <7vodqse90q.fsf@assigned-by-dhcp.cox.net> <87ac2cwha4.wl%cworth@cworth.org> <7vy7pwcsgp.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Mon_Nov_27_17:35:10_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit NNTP-Posting-Date: Tue, 28 Nov 2006 01:36:18 +0000 (UTC) Cc: git@vger.kernel.org Return-path: Envelope-to: gcvg-git@gmane.org In-Reply-To: <7vy7pwcsgp.fsf@assigned-by-dhcp.cox.net> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GortP-0007tN-Ug for gcvg-git@gmane.org; Tue, 28 Nov 2006 02:36:16 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757734AbWK1BgM (ORCPT ); Mon, 27 Nov 2006 20:36:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933880AbWK1BgM (ORCPT ); Mon, 27 Nov 2006 20:36:12 -0500 Received: from mx1.redhat.com ([66.187.233.31]:18315 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1757734AbWK1BgL (ORCPT ); Mon, 27 Nov 2006 20:36:11 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kAS1a9p4011849; Mon, 27 Nov 2006 20:36:09 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kAS1a4lg012270; Mon, 27 Nov 2006 20:36:04 -0500 Received: from raht.cworth.org (sebastian-int.corp.redhat.com [172.16.52.221]) by mail.boston.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kAS1a2Lw020138; Mon, 27 Nov 2006 20:36:03 -0500 To: Junio C Hamano Sender: git-owner@vger.kernel.org --pgp-sign-Multipart_Mon_Nov_27_17:35:10_2006-1 Content-Type: text/plain; charset=US-ASCII On Mon, 27 Nov 2006 16:42:14 -0800, Junio C Hamano wrote: > I think you are teaching backwards. Couldn't you start like this? > > "git commit" takes the list of paths you want to commit. I've always started teaching with: git init-db git add file git commit -m "Initial commit" # edit file git commit -a -m "edit file" And at that point I've either apologized about "-a" or been asked a question about it. Every time. But it's the tutorial we were talking about: http://www.kernel.org/pub/software/scm/git/docs/tutorial.html That has 6 examples of commit being used, and all of them are with "commit -a". What "git commit" does without -a must certainly be a question in the mind of any reader, (the tutorial doesn't mention anything). And unlike when I'm teaching in person, when the reader reads the tutorial, there's no person to explain the situation. The reader might just remain confused, or they might consult the documentation for git-commit and find a first sentence that says: Updates the index file for given paths, or all modified files if -a is specified, and makes a commit object. And then we're back to the question of "what the heck is an index, and why do I care?". If the "commit the index" operation were moved to a non-default command-line option of git-commit, then the commit command could be explained without having to introduce the notion of the index at all. This would be a good thing. I don't think we have any introductory documentation that introduces the index until the "core tutorial" and my goal here is to allow an introduction to using git that doesn't require that level of detail. One of the arguments I got here on the git mailing list when I first brought up these kinds of "hide the index" proposals, (back in February or so), was that the index is essential to understand for merging anyway, and that I should just teach it early on. I've tried the "teach it early" approach in the months since and found it to be largely a failure. Most new users react by deciding that git is more complicated than other systems, or that it's more specialized or not targeted at someone with their needs. As for merging, I'd rather introduce the new "git resolve" syntax so that merging could be explained in terms of the working tree without having to fully understand the index either. If we could fix "git commit" and add "git resolve" I think we would most of the confusion/complaints that I've encountered in 8 months of teaching git. There would still be some aspects of "git diff" that are potentially confusing without understanding the index, but that's been much less of a problem than "commit -a" in my experience. -Carl --pgp-sign-Multipart_Mon_Nov_27_17:35:10_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFa5JU6JDdNq8qSWgRArHYAJ9lILG7s6Bc2CoYLYG0QGaTnvAgAQCeLIrK gsBzLk0hQTX8b25dNgohKW4= =8MLk -----END PGP SIGNATURE-----