From: Sverre Rabbelier <srabbelier@gmail.com>
To: Thore Husfeldt <thore.husfeldt@gmail.com>
Cc: git@vger.kernel.org, Scott Chacon <schacon@gmail.com>,
Jonathan Nieder <jrnieder@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: Git terminology: remote, add, track, stage, etc.
Date: Mon, 18 Oct 2010 16:35:32 -0500 [thread overview]
Message-ID: <AANLkTimkovH9OysLSxA+=di89Xi+dTCYL5hRPmNaADDH@mail.gmail.com> (raw)
In-Reply-To: <8835ADF9-45E5-4A26-9F7F-A72ECC065BB2@gmail.com>
Heya,
[+Scott, who's done a lot of work on making git more newbie friendly]
[+Jonathan, I saw his reply just before sending this]
On Mon, Oct 18, 2010 at 15:45, Thore Husfeldt <thore.husfeldt@gmail.com> wrote:
> I’ve just learned Git. What a wonderful system, thanks for building
> it.
Thanks.
> And what an annoying learning experience.
Thanks again :).
> I promised myself to try to remember what made it all so hard, and to
> write it down in a comprehensive and possibly even constructive
> fashion. Here it is, for what it’s worth. Read it as the friendly, but
> somewhat exasperated suggestions of a newcomer. I’d love to help (in
> the form of submitting patches to the documentation or CLI responses),
> but I’d like to test the waters first.
Awesome! Your experiences are very welcome indeed!
> So, remote tracking branches are neither remote (they are *local*
> copies of how the remote once was) and they stand completely still
> until you tell them to “fetch”. So remote means local, and tracking
> means still, “local still-standing” would be a less confusing term
> that “remote tracking”. Lovely.
*chortles*, nicely observed.
> The hyphenated *remote-tracking* is a lot better terminology already
> (and sometimes even used in the documentation), because at least it
> doesn't pretend to be a remote branch (`git branch -r`, of course,
> still does).
What do you mean with the last part (about `git branch -r`)? The fact
that 'refs/remotes' is not immutable?
> So that single hyphen already does some good, and should
> be edited for consistency.
If we agree that "remote-tracking" is the way to go, a patch doing
such editing would be very welcome.
> And *even if* the word was meaningful and consistently spelt, the
> documentation uses it to *refer* to different things. Assume that we
> have the branches master, origin/master, and origin’s master
> (understanding that they exist, and are different, is another Aha!
> moment largely prevented by the documentation).
How could the documentation make this more clear?
> Or rather, it is the confirmation one needs that nobody in the Git
> community cares much
On the contrary, we care a lot, but once you're not a new user
yourself anymore, it's hard to know what to fix.
> There probably is a radical case to be made for abandoning the word
> “tracking” entirely. First, because tracking branches don’t track, and
> second because “tracking” already means something else in Git (see
> below). I realise that this terminology is now so ingrained in Git
> users that conservatism will probably perpetuate it. But it would be
> *very* helpful to think this through, and at least agree on who
> “tracks” what. In the ideal world, origin/master would be something
> like “the fetching branch” for the origin’s master, or the “snapshot
> branch” or the “fetched branch”.
> [...]
> More radically, I am sure some head scratching would be able to find
> useful terminology for master, origin/master, and origin’s master. I’d
> love to see suggestions. As I said, I admire how wonderfully simple
> and clean this has been implemented, and the documentation, CLI, and
> terminology should reflect that.
I don't have any objections to changing these terms, but I don't have
any suggestions on what to change them _to_.
> 2. Introduce the alias `git unstage` for `git reset HEAD` in the
> standard distribution.
(or 'git rm --cached' for newly added files)
> nothing added to commit but untracked files present
>
> should be
>
> nothing staged to commit, but untracked files present
I've always liked the whole 'stage(d)' concept, so I like this, but I
remember Junio being fairly hesitant to use it more extensively.
> (Comment: maybe “... but working directory contains untracked files.”
> I realise that “directory” is not quite comprehensive here, because
> files can reside in subdirectories.
We use "worktree" elsewhere, how about that?
> (use "git track <file>" to track)
So basically you want to split out 'git add' into 'git track' and 'git stage'?
> Changes to be committed:
> (use "git reset HEAD <file>..." to unstage)
>
> should be
>
> Staged to be committed:
> (use "git unstage <file>" to unstage)
This would be extra nice since 'git unstage' could also be used in a
fresh repository.
> But this is a good example of what’s wrong with the way the
> documentation thinks: Git’s implementation perspective should not
> define how concepts are explained. In particular, *tracking* (in the
> sense of making a file known to git) and *staging* are conceptually
> different things. In fact, the two things remain conceptually
> different later on: un-tracking (removing the file from Git’s
> worldview) and un-staging are not the same thing at all, neither
> conceptually nor implementationally.
Fair point, I think.
> The opposite of staging is `git
> reset HEAD <file>` and the opposite of tracking is -- well, I’m not
> sure, actually. Maybe `git update-index --force-remove <filename>`?
'git rm --cached'
> The entire quoted paragraph in the tutorial can be removed: there’s
> simply no reason to tell the reader that git behaves differently from
> other version control systems
I disagree, many people come from another VCS, and pointing out where
their assumptions are invalid is generally useful.
> There’s another issue with this, namely that “added files are
> immediately staged”. In fact, I do understand why Git does that, but
> conceptually it’s pure evil: one of the conceptual conrnerstones of
> Git -- that files can be tracked and changed yet not staged, i.e., the
> staging areas is conceptually a first-class citizen -- is violated
> every time a new file is “born”. Newborn files are *special* until
> their first commit, and that’s a shame, because the first thing the
> new file (and, vicariously, the new user) experiences is an
> aberration.
Eh, I think it's not an aberration, it's more of a convenience. I
don't think the benefit of making the concept of tracking vs. staging
clear to the user is worth the hassle of having to execute two things
to do one thing (staging a new file). You can also see it the other
way around, why are new files any different from other files? Why
shouldn't you be able to stage new files?
--
Cheers,
Sverre Rabbelier
next prev parent reply other threads:[~2010-10-18 21:36 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-18 20:45 Git terminology: remote, add, track, stage, etc Thore Husfeldt
2010-10-18 21:15 ` Jonathan Nieder
2010-10-18 22:48 ` [RFC/PATCH] reset: accept "git reset <removed file>" Jonathan Nieder
2010-10-18 23:56 ` Junio C Hamano
2010-10-19 0:23 ` Jonathan Nieder
2010-10-19 17:34 ` Junio C Hamano
2010-10-19 22:34 ` Jonathan Nieder
2010-10-18 21:35 ` Sverre Rabbelier [this message]
2010-10-19 0:03 ` Git terminology: remote, add, track, stage, etc Junio C Hamano
2010-10-19 17:51 ` Ramkumar Ramachandra
2010-10-19 18:28 ` Jonathan Nieder
2010-10-19 18:34 ` Sverre Rabbelier
2010-10-19 18:43 ` Thore Husfeldt
2010-10-19 19:04 ` User manual: "You cannot check out these remote-tracking branches" Jonathan Nieder
2010-10-19 20:52 ` Matthieu Moy
2010-10-19 19:15 ` Git terminology: remote, add, track, stage, etc Nicolas Pitre
2010-10-19 19:20 ` Junio C Hamano
2010-10-19 22:10 ` [RFC/PATCH 0/4] reset: be more flexible about <rev> Jonathan Nieder
2010-10-19 22:11 ` [WIP/PATCH 1/4] reset -p: accept "git reset -p <tree>" Jonathan Nieder
2010-10-19 22:12 ` [PATCH 2/4] reset: accept "git reset <tree> <path>" Jonathan Nieder
2010-10-19 22:13 ` [PATCH 3/4] reset: accept "git reset -- <path>" from unborn branch Jonathan Nieder
2010-10-19 22:14 ` [PATCH 4/4] reset: accept "git reset HEAD " Jonathan Nieder
2010-10-19 23:08 ` Junio C Hamano
2010-10-19 23:26 ` Jonathan Nieder
2010-10-27 15:03 ` Git terminology: remote, add, track, stage, etc Ramkumar Ramachandra
2010-10-27 15:16 ` Drew Northup
2010-10-27 16:08 ` Matthieu Moy
2010-10-28 15:20 ` Ramkumar Ramachandra
2010-10-28 18:25 ` Matthieu Moy
2010-10-18 21:41 ` Matthieu Moy
2010-10-19 4:49 ` Miles Bader
2010-10-19 7:19 ` Wincent Colaiuta
2010-10-19 7:48 ` Miles Bader
2010-10-19 8:05 ` Wincent Colaiuta
2010-10-19 15:09 ` Eugene Sajine
2010-10-22 20:16 ` Paul Bolle
2010-10-22 21:00 ` Eugene Sajine
2010-10-22 21:46 ` Drew Northup
2010-10-20 9:53 ` Thore Husfeldt
2010-10-20 11:34 ` Matthieu Moy
2010-10-20 14:01 ` Drew Northup
2010-10-18 21:57 ` Jakub Narebski
2010-10-19 8:05 ` Matthijs Kooijman
2010-10-19 8:27 ` Jakub Narebski
2010-10-19 17:30 ` Thore Husfeldt
2010-10-19 20:57 ` Jakub Narebski
2010-10-21 8:44 ` Michael Haggerty
2010-10-21 11:20 ` Drew Northup
2010-10-21 12:31 ` Thore Husfeldt
2010-10-21 12:56 ` Drew Northup
2010-10-21 14:06 ` Thore Husfeldt
2010-10-21 20:06 ` Drew Northup
2010-10-22 4:07 ` Miles Bader
2010-10-22 11:51 ` Drew Northup
2010-10-19 14:39 ` [PATCH v3] Porcelain scripts: Rewrite cryptic "needs update" error message Ramkumar Ramachandra
2010-10-27 14:55 ` Ramkumar Ramachandra
2010-11-05 22:38 ` Junio C Hamano
2011-02-12 23:14 ` Ævar Arnfjörð Bjarmason
2010-10-19 21:53 ` Git terminology: remote, add, track, stage, etc Drew Northup
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='AANLkTimkovH9OysLSxA+=di89Xi+dTCYL5hRPmNaADDH@mail.gmail.com' \
--to=srabbelier@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=schacon@gmail.com \
--cc=thore.husfeldt@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).