Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Stefan Beller
On Thu, Dec 14, 2017 at 1:16 PM, David A. Wheeler  wrote:
> "David A. Wheeler"  writes:
>> > Why is "index" better? It is a confusing name, one that has many
>> > other unrelated meanings.  In particular, many projects managed by
>> > git also have an index, but few have a staging area.
>
> On Thu, 14 Dec 2017 11:40:51 -0800, Junio C Hamano  wrote:
>> That's an absurd argument.  A database product that wants to be used
>> in library systems are forbidden to have "index" because that may be
>> confused with library index cards?
>
> No, because most database systems aren't designed to be primarily used
> in library systems.  Even if they are, I haven't seen a "library index card"
> in decades (many people will not know what they are), so
> that is much less likely to be confusing.
>
> In contrast, git is widely used to manage source code (where "index" often
> means "array index", "hash index", and so on) and/or HTML
> (where "index.html" is pretty common).  Using the *same* term for something
> git often manages *is* confusing.
>
> Even if you don't buy that argument, I think most newer users find the term
> "staging area" simpler... and we are *all* new to something at one time.
>
> A Google of git "staging area" returns 67,000 results, and "staging area"
> is *much* newer terminology than "index" and has those hits in *spite* of
> "index" and "cache" being the historical terms.
>
> Is there a term you'd prefer over "index" or "cache"?
>

I would personally prefer to drop 'cache', as the mechanism involved
is not a cache from the users point of view. (A cache is not affecting
behavior except for performance. In Git this "index" does affect more
than just performance, it also allows a very specific workflow.)

Personally I am indifferent to whether we call it index or staging
area as long as it is consistent. Junio mentioned the 'X acts like Y'
is different from 'X is Y'", so maybe we can use both words, as in
"Use git-add to add files into the index, which is used as a staging
area for the next commit".

Note that this discussion seems to be quite old (way older than
my contribution record):

$ git log --grep "staging area"
...
commit 11920d28da1ac1b65eb4041c1b7355924e5d1366
Author: Scott Chacon 
Date:   2008-12-01 22:14

Add a built-in alias for 'stage' to the 'add' command

This comes from conversation at the GitTogether where we thought it would
be helpful to be able to teach people to 'stage' files because it tends
to cause confusion when told that they have to keep 'add'ing them.

This continues the movement to start referring to the index as a
staging area (eg: the --staged alias to 'git diff'). Also adds a
doc file for 'git stage' that basically points to the docs for
'git add'.

Signed-off-by: Scott Chacon 
Signed-off-by: Junio C Hamano 


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Ævar Arnfjörð Bjarmason

On Thu, Dec 14 2017, Junio C. Hamano jotted:

> Stefan Beller  writes:
>
>> Anyway I think spending list band width on good documentation is
>> not bandwidth wasted.
>
> I agree with that.  I do not consider the proposed change "good".

The case you're talking about upthread is something which we could
describe in the docs as "the starting point of the staging area is that
it's equivalent to the current commit, and is thus used as an
index/cache by various commands", if that ever comes up.

I think in the vast majority of other cases talking about it as the
staging area would be an improvement, since that's the function that has
the closest correspondence to what the UI is actually doing, that we're
using it as a cache / index is usually (always?) an implementation
detail.

Even the merge case you mentioned is something where staging area makes
more sense: "We tried to merge, but had a conflict, we've staged some of
your changes leaving the rest for you to sort out".


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Junio C Hamano
"David A. Wheeler"  writes:

> On December 14, 2017 1:50:00 PM EST, Junio C Hamano  wrote:
>>I agree with that.  I do not consider the proposed change "good".
>
> Why is "index" better? It is a confusing name, one that has many
> other unrelated meanings.  In particular, many projects managed by
> git also have an index, but few have a staging area.

That's an absurd argument.  A database product that wants to be used
in library systems are forbidden to have "index" because that may be
confused with library index cards?

> Also, the phrase "staging area" is already in use, so this is not
> a new term (e.g., git-staging).

That gets us back to the "'X acts like Y' is different from 'X is
Y'".  

Besides, the phrase "staging area" is a near-sighted and narrow
minded term.  It focuses too much on working towards the next
commit, and ignores there are other aspects that are equally
important.  When you check out historical revisions (without any
intention of making new commits, just sightseeing), for example, the
index does not act as "staging area" for creating a new commit.  But
it still serves Git users by keeping track of the list of paths that
came from the HEAD, and recording their contents and the cached stat
info for the working tree files (all using the pathnames as keys
into these data items).



Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread David A. Wheeler
On December 14, 2017 1:50:00 PM EST, Junio C Hamano  wrote:
>I agree with that.  I do not consider the proposed change "good".

Why is "index" better? It is a confusing name, one that has many other 
unrelated meanings.  In particular, many projects managed by git also have an 
index, but few have a staging area.

Also, the phrase "staging area" is already in use, so this is not a new term 
(e.g., git-staging).


--- David A.Wheeler


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Junio C Hamano
Stefan Beller  writes:

> Anyway I think spending list band width on good documentation is
> not bandwidth wasted.

I agree with that.  I do not consider the proposed change "good".



Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Stefan Beller
On Thu, Dec 14, 2017 at 10:08 AM, Junio C Hamano  wrote:
> Ævar Arnfjörð Bjarmason  writes:
>
>> On Wed, Dec 13, 2017 at 6:46 AM, David A. Wheeler  
>> wrote:
>>> On December 13, 2017 12:40:12 AM EST, Jacob Keller  
>>> wrote:
I know we've used various terms for this concept across a lot of the
documentation. However, I was under the impression that we most
explicitly used "index" rather than "staging area".
>>>
>>> I think "staging area" is the better term. It focuses on its purpose, and 
>>> it is also less confusing ("index" and "cache" have other meanings in many 
>>> of the repos managed by git).
>>
>> After your patch the majority of the docs will still talk about
>> "index", is this part of some larger series, perhaps it would be good
>> to see it all at once...
>
> ... or none of it.  I do not quite see a point of spending list
> bandwidth on a change like this one.

I think wording (as well as its consistency) in the documentation
is rather important.

Just the other day I was reading[1], yet another blog explaining
why git sucks. TL;DR:
(1) (a) The staging area is an advanced concept
and should be disabled by default
(b) and is documented super confusingly.
(2) Branches and Remotes Management is
Complex and Time-Consuming
(3) its ecosystem (GitHub et al.) is not pushing for
innovation, because "forks are not the right model".

[1] 
https://gregoryszorc.com/blog/2017/12/11/high-level-problems-with-git-and-how-to-fix-them/

When I saw the original patch, I assumed it was a reaction to this
blog and attempting to fix (1b), but maybe it is unrelated.

Anyway I think spending list band width on good documentation is
not bandwidth wasted.

Stefan


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason  writes:

> On Wed, Dec 13, 2017 at 6:46 AM, David A. Wheeler  
> wrote:
>> On December 13, 2017 12:40:12 AM EST, Jacob Keller  
>> wrote:
>>>I know we've used various terms for this concept across a lot of the
>>>documentation. However, I was under the impression that we most
>>>explicitly used "index" rather than "staging area".
>>
>> I think "staging area" is the better term. It focuses on its purpose, and it 
>> is also less confusing ("index" and "cache" have other meanings in many of 
>> the repos managed by git).
>
> After your patch the majority of the docs will still talk about
> "index", is this part of some larger series, perhaps it would be good
> to see it all at once...

... or none of it.  I do not quite see a point of spending list
bandwidth on a change like this one.


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread Ævar Arnfjörð Bjarmason

On Thu, Dec 14 2017, David A. Wheeler jotted:

> On December 13, 2017 7:54:04 AM EST, "Ævar Arnfjörð Bjarmason" 
>  wrote:
>>After your patch the majority of the docs will still talk about
>>"index", is this part of some larger series, perhaps it would be good
>>to see it all at once...
>
> Yes, this would be part of a larger series.
>
> I'm happy to do the work, but I don't want to do it if it's just going to be 
> rejected.
>
> The work is very straightforward, in almost all cases you simply replace the 
> word index with the phrase staging area.  The change is similar for the word 
> cache.  So I'm not sure what seeing it all at once would do for anybody.
>
> Are there one or two other files that you would like to see transformed to 
> see as an example?  If you're just looking for a sense of it, that should be 
> enough.

No I get the idea, I'm just wondering if you'll continue to work on
this, because if not mentioning "staging area" in more places without
continuing to eradicate "index" isn't going to improve things much, and
possibly make it worse. I like the direction of this series.


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-14 Thread David A. Wheeler
On December 13, 2017 7:54:04 AM EST, "Ævar Arnfjörð Bjarmason" 
 wrote:
>After your patch the majority of the docs will still talk about
>"index", is this part of some larger series, perhaps it would be good
>to see it all at once...

Yes, this would be part of a larger series.

I'm happy to do the work, but I don't want to do it if it's just going to be 
rejected.

The work is very straightforward, in almost all cases you simply replace the 
word index with the phrase staging area.  The change is similar for the word 
cache.  So I'm not sure what seeing it all at once would do for anybody.

Are there one or two other files that you would like to see transformed to see 
as an example?  If you're just looking for a sense of it, that should be enough.




--- David A.Wheeler


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-13 Thread David A. Wheeler
On Wed, 13 Dec 2017 09:02:42 -0800, Junio C Hamano  wrote:
> .. But that is not the only thing the index does.  When "git merge"
> finds conflicting changes, it adds the contents for common, our and
> their variants to the index for the path.  This is quite different
> from how you use the index "as staging area"; the index is being
> used as the "merging area".  When "git clean" wants to see which
> paths it finds on the filesystem are not of interest, it consults
> the index, which acts as the list of paths that are of interest.

If the phrase "staging area" is consistently used *instead* of index,
there's no problem. E.g., "git clean consults the staging area"
conveys exactly the same information as "git clean consults the index"
when index == staging area.

The term "index" has too many *other* meanings.

--- David A. Wheeler


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-13 Thread Junio C Hamano
Jacob Keller  writes:

> I know we've used various terms for this concept across a lot of the
> documentation. However, I was under the impression that we most
> explicitly used "index" rather than "staging area".
>
> Additionally, I think there are many other locations which
> consistently use "index" as the term already.

Another reason why we would want to standardize in the other
direction is because "X acts as Y" does not mean "X is Y".

It is true that we (and also "newbie friendly" tutorials) often
explain the index like so: "When working towards the next commit,
you improve the contents a bit in the working tree, you 'git add' it
to the index to make the contents of the index closer to what you
want to have the next commit.  The index works like the staging
area."

But that is not the only thing the index does.  When "git merge"
finds conflicting changes, it adds the contents for common, our and
their variants to the index for the path.  This is quite different
from how you use the index "as staging area"; the index is being
used as the "merging area".  When "git clean" wants to see which
paths it finds on the filesystem are not of interest, it consults
the index, which acts as the list of paths that are of interest.


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-13 Thread Ævar Arnfjörð Bjarmason
On Wed, Dec 13, 2017 at 6:46 AM, David A. Wheeler  wrote:
> On December 13, 2017 12:40:12 AM EST, Jacob Keller  
> wrote:
>>I know we've used various terms for this concept across a lot of the
>>documentation. However, I was under the impression that we most
>>explicitly used "index" rather than "staging area".
>
> I think "staging area" is the better term. It focuses on its purpose, and it 
> is also less confusing ("index" and "cache" have other meanings in many of 
> the repos managed by git).

After your patch the majority of the docs will still talk about
"index", is this part of some larger series, perhaps it would be good
to see it all at once...


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-12 Thread David A. Wheeler
On December 13, 2017 12:40:12 AM EST, Jacob Keller  
wrote:
>I know we've used various terms for this concept across a lot of the
>documentation. However, I was under the impression that we most
>explicitly used "index" rather than "staging area".

I think "staging area" is the better term. It focuses on its purpose, and it is 
also less confusing ("index" and "cache" have other meanings in many of the 
repos managed by git).


--- David A.Wheeler


Re: [PATCH] doc: Modify git-add doc to say "staging area"

2017-12-12 Thread Jacob Keller
On Tue, Dec 12, 2017 at 6:32 PM, David A. Wheeler  wrote:
> Change the documentation of git-add so that it consistently uses
> the phrase "staging area".  The current git documentation uses
> inconsistent terminology ("index", "cache", and "staging area").
> This commit switches git-add's documentation to consistently use
> the phrase "staging area", which is higher-level and should be less
> confusing for new users.
>

I know we've used various terms for this concept across a lot of the
documentation. However, I was under the impression that we most
explicitly used "index" rather than "staging area".

Additionally, I think there are many other locations which
consistently use "index" as the term already.

Thanks,
Jake