git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] doc: Modify git-add doc to say "staging area"
@ 2017-12-13  2:32 David A. Wheeler
  2017-12-13  5:40 ` Jacob Keller
  0 siblings, 1 reply; 15+ messages in thread
From: David A. Wheeler @ 2017-12-13  2:32 UTC (permalink / raw)
  To: git

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.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
---
 Documentation/git-add.txt | 104 ++++++++++++++++++++++++----------------------
 1 file changed, 54 insertions(+), 50 deletions(-)

diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index d50fa339d..927a152b0 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -3,7 +3,7 @@ git-add(1)
 
 NAME
 ----
-git-add - Add file contents to the index
+git-add - Add file contents to the staging area
 
 SYNOPSIS
 --------
@@ -15,23 +15,24 @@ SYNOPSIS
 
 DESCRIPTION
 -----------
-This command updates the index using the current content found in
-the working tree, to prepare the content staged for the next commit.
-It typically adds the current content of existing paths as a whole,
+This command updates the staging area using the current content found
+in the working tree.
+This command typically adds the current content of existing paths as a whole,
 but with some options it can also be used to add content with
 only part of the changes made to the working tree files applied, or
 remove paths that do not exist in the working tree anymore.
 
-The "index" holds a snapshot of the content of the working tree, and it
-is this snapshot that is taken as the contents of the next commit.  Thus
-after making any changes to the working tree, and before running
-the commit command, you must use the `add` command to add any new or
-modified files to the index.
+The staging area (historically called the "index" or "cache")
+holds a snapshot of the content of the working tree, and it
+is this snapshot that is taken by default as the contents of the next commit.
+Thus after making any changes to the working tree, and before running
+the commit command, you can use the `add` command to add any new or
+modified files to the staging area.
 
 This command can be performed multiple times before a commit.  It only
 adds the content of the specified file(s) at the time the add command is
 run; if you want subsequent changes included in the next commit, then
-you must run `git add` again to add the new content to the index.
+you must run `git add` again to add the new content to the staging area.
 
 The `git status` command can be used to obtain a summary of which
 files have changes that are staged for the next commit.
@@ -45,7 +46,9 @@ be used to add ignored files with the `-f` (force) option.
 
 Please see linkgit:git-commit[1] for alternative ways to add content to a
 commit.
-
+For example, you can use the git commit `-a` option to first automatically
+add to the staging area all the files that have been have been
+modified or deleted in the working tree.
 
 OPTIONS
 -------
@@ -53,7 +56,7 @@ OPTIONS
 	Files to add content from.  Fileglobs (e.g. `*.c`) can
 	be given to add all matching files.  Also a
 	leading directory name (e.g. `dir` to add `dir/file1`
-	and `dir/file2`) can be given to update the index to
+	and `dir/file2`) can be given to update the staging area to
 	match the current state of the directory as a whole (e.g.
 	specifying `dir` will record not just a file `dir/file1`
 	modified in the working tree, a file `dir/file2` added to
@@ -81,16 +84,16 @@ in linkgit:gitglossary[7].
 -i::
 --interactive::
 	Add modified contents in the working tree interactively to
-	the index. Optional path arguments may be supplied to limit
+	the staging area. Optional path arguments may be supplied to limit
 	operation to a subset of the working tree. See ``Interactive
 	mode'' for details.
 
 -p::
 --patch::
-	Interactively choose hunks of patch between the index and the
-	work tree and add them to the index. This gives the user a chance
+	Interactively choose hunks of patch between the staging area and the
+	work tree and add them to the staging area. This gives the user a chance
 	to review the difference before adding modified contents to the
-	index.
+	staging area.
 +
 This effectively runs `add --interactive`, but bypasses the
 initial command menu and directly jumps to the `patch` subcommand.
@@ -98,20 +101,20 @@ See ``Interactive mode'' for details.
 
 -e::
 --edit::
-	Open the diff vs. the index in an editor and let the user
+	Open the diff vs. the staging area in an editor and let the user
 	edit it.  After the editor was closed, adjust the hunk headers
-	and apply the patch to the index.
+	and apply the patch to the staging area.
 +
 The intent of this option is to pick and choose lines of the patch to
 apply, or even to modify the contents of lines to be staged. This can be
 quicker and more flexible than using the interactive hunk selector.
 However, it is easy to confuse oneself and create a patch that does not
-apply to the index. See EDITING PATCHES below.
+apply to the staging area. See EDITING PATCHES below.
 
 -u::
 --update::
-	Update the index just where it already has an entry matching
-	<pathspec>.  This removes as well as modifies index entries to
+	Update the staging area just where it already has an entry matching
+	<pathspec>.  This removes as well as modifies staging area entries to
 	match the working tree, but adds no new files.
 +
 If no <pathspec> is given when `-u` option is used, all
@@ -122,9 +125,9 @@ subdirectories).
 -A::
 --all::
 --no-ignore-removal::
-	Update the index not only where the working tree has a file
-	matching <pathspec> but also where the index already has an
-	entry.	This adds, modifies, and removes index entries to
+	Update the staging area not only where the working tree has a file
+	matching <pathspec> but also where the staging area already has an
+	entry.	This adds, modifies, and removes staging area entries to
 	match the working tree.
 +
 If no <pathspec> is given when `-A` option is used, all
@@ -134,8 +137,8 @@ subdirectories).
 
 --no-all::
 --ignore-removal::
-	Update the index by adding new files that are unknown to the
-	index and files modified in the working tree, but ignore
+	Update the staging area by adding new files that are not in the
+	staging area and files modified in the working tree, but ignore
 	files that have been removed from the working tree.  This
 	option is a no-op when no <pathspec> is used.
 +
@@ -146,18 +149,19 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files.
 -N::
 --intent-to-add::
 	Record only the fact that the path will be added later. An entry
-	for the path is placed in the index with no content. This is
+	for the path is placed in the staging area with no content. This is
 	useful for, among other things, showing the unstaged content of
 	such files with `git diff` and committing them with `git commit
 	-a`.
 
 --refresh::
 	Don't add the file(s), but only refresh their stat()
-	information in the index.
+	information in the staging area.
 
 --ignore-errors::
-	If some files could not be added because of errors indexing
-	them, do not abort the operation, but continue adding the
+	If some files could not be added because of errors adding them
+        to the staging area,
+	do not abort the operation, but continue adding the
 	others. The command shall still exit with non-zero status.
 	The configuration variable `add.ignoreErrors` can be set to
 	true to make this the default behaviour.
@@ -170,21 +174,21 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files.
 
 --no-warn-embedded-repo::
 	By default, `git add` will warn when adding an embedded
-	repository to the index without using `git submodule add` to
+	repository to the staging area without using `git submodule add` to
 	create an entry in `.gitmodules`. This option will suppress the
 	warning (e.g., if you are manually performing operations on
 	submodules).
 
 --renormalize::
 	Apply the "clean" process freshly to all tracked files to
-	forcibly add them again to the index.  This is useful after
+	forcibly add them again to the staging area.  This is useful after
 	changing `core.autocrlf` configuration or the `text` attribute
 	in order to correct files added with wrong CRLF/LF line endings.
 	This option implies `-u`.
 
 --chmod=(+|-)x::
 	Override the executable bit of the added files.  The executable
-	bit is only changed in the index, the files on disk are left
+	bit is only changed in the staging area, the files on disk are left
 	unchanged.
 
 \--::
@@ -251,8 +255,8 @@ The main command loop has 6 subcommands (plus help and quit).
 
 status::
 
-   This shows the change between HEAD and index (i.e. what will be
-   committed if you say `git commit`), and between index and
+   This shows the change between HEAD and staging area (i.e. what will be
+   committed if you say `git commit`), and between staging area and
    working tree files (i.e. what you could stage further before
    `git commit` using `git add`) for each path.  A sample output
    looks like this:
@@ -265,11 +269,11 @@ status::
 +
 It shows that foo.png has differences from HEAD (but that is
 binary so line count cannot be shown) and there is no
-difference between indexed copy and the working tree
-version (if the working tree version were also different,
+difference between the versions in the staging area and the working tree
+(if the working tree version were also different,
 'binary' would have been shown in place of 'nothing').  The
 other file, git-add{litdd}interactive.perl, has 403 lines added
-and 35 lines deleted if you commit what is in the index, but
+and 35 lines deleted if you commit what is in the staging area, but
 working tree file has further modifications (one addition and
 one deletion).
 
@@ -300,7 +304,7 @@ Update>> -2
 ------------
 +
 After making the selection, answer with an empty line to stage the
-contents of working tree files for selected paths in the index.
+contents of working tree files for selected paths in the staging area.
 
 revert::
 
@@ -311,12 +315,12 @@ revert::
 add untracked::
 
   This has a very similar UI to 'update' and
-  'revert', and lets you add untracked paths to the index.
+  'revert', and lets you add untracked paths to the staging area.
 
 patch::
 
   This lets you choose one path out of a 'status' like selection.
-  After choosing the path, it presents the diff between the index
+  After choosing the path, it presents the diff between the staging area
   and the working tree file and asks you if you want to stage
   the change of each hunk.  You can select one of the following
   options and type return:
@@ -337,7 +341,7 @@ patch::
        ? - print help
 +
 After deciding the fate for all hunks, if there is any hunk
-that was chosen, the index is updated with the selected hunks.
+that was chosen, the staging area is updated with the selected hunks.
 +
 You can omit having to type return here, by setting the configuration
 variable `interactive.singleKey` to `true`.
@@ -345,7 +349,7 @@ variable `interactive.singleKey` to `true`.
 diff::
 
   This lets you review what will be committed (i.e. between
-  HEAD and index).
+  HEAD and staging area).
 
 
 EDITING PATCHES
@@ -353,10 +357,10 @@ EDITING PATCHES
 
 Invoking `git add -e` or selecting `e` from the interactive hunk
 selector will open a patch in your editor; after the editor exits, the
-result is applied to the index. You are free to make arbitrary changes
+result is applied to the staging area. You are free to make arbitrary changes
 to the patch, but note that some changes may have confusing results, or
 even result in a patch that cannot be applied.  If you want to abort the
-operation entirely (i.e., stage nothing new in the index), simply delete
+operation entirely (i.e., stage nothing new in the staging area), simply delete
 all lines of the patch. The list below describes some common things you
 may see in a patch, and which editing operations make sense on them.
 
@@ -377,13 +381,13 @@ Modified content is represented by "-" lines (removing the old content)
 followed by "{plus}" lines (adding the replacement content). You can
 prevent staging the modification by converting "-" lines to " ", and
 removing "{plus}" lines. Beware that modifying only half of the pair is
-likely to introduce confusing changes to the index.
+likely to introduce confusing changes to the staging area.
 --
 
 There are also more complex operations that can be performed. But beware
-that because the patch is applied only to the index and not the working
-tree, the working tree will appear to "undo" the change in the index.
-For example, introducing a new line into the index that is in neither
+that because the patch is applied only to the staging area and not the working
+tree, the working tree will appear to "undo" the change in the staging area.
+For example, introducing a new line into the staging area that is in neither
 the HEAD nor the working tree will stage the new line for commit, but
 the line will appear to be reverted in the working tree.
 
@@ -392,7 +396,7 @@ Avoid using these constructs, or do so with extreme caution.
 --
 removing untouched content::
 
-Content which does not differ between the index and working tree may be
+Content which does not differ between the staging area and working tree may be
 shown on context lines, beginning with a " " (space).  You can stage
 context lines for removal by converting the space to a "-". The
 resulting working tree file will appear to re-add the content.
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13  2:32 [PATCH] doc: Modify git-add doc to say "staging area" David A. Wheeler
@ 2017-12-13  5:40 ` Jacob Keller
  2017-12-13  5:46   ` David A. Wheeler
  2017-12-13 17:02   ` Junio C Hamano
  0 siblings, 2 replies; 15+ messages in thread
From: Jacob Keller @ 2017-12-13  5:40 UTC (permalink / raw)
  To: David A. Wheeler; +Cc: git

On Tue, Dec 12, 2017 at 6:32 PM, David A. Wheeler <dwheeler@dwheeler.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13  5:40 ` Jacob Keller
@ 2017-12-13  5:46   ` David A. Wheeler
  2017-12-13 12:54     ` Ævar Arnfjörð Bjarmason
  2017-12-13 17:02   ` Junio C Hamano
  1 sibling, 1 reply; 15+ messages in thread
From: David A. Wheeler @ 2017-12-13  5:46 UTC (permalink / raw)
  To: Jacob Keller; +Cc: git

On December 13, 2017 12:40:12 AM EST, Jacob Keller <jacob.keller@gmail.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13  5:46   ` David A. Wheeler
@ 2017-12-13 12:54     ` Ævar Arnfjörð Bjarmason
  2017-12-14 17:48       ` David A. Wheeler
  2017-12-14 18:08       ` Junio C Hamano
  0 siblings, 2 replies; 15+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-12-13 12:54 UTC (permalink / raw)
  To: David A. Wheeler; +Cc: Jacob Keller, git

On Wed, Dec 13, 2017 at 6:46 AM, David A. Wheeler <dwheeler@dwheeler.com> wrote:
> On December 13, 2017 12:40:12 AM EST, Jacob Keller <jacob.keller@gmail.com> 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...

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13  5:40 ` Jacob Keller
  2017-12-13  5:46   ` David A. Wheeler
@ 2017-12-13 17:02   ` Junio C Hamano
  2017-12-13 18:46     ` David A. Wheeler
  1 sibling, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2017-12-13 17:02 UTC (permalink / raw)
  To: Jacob Keller; +Cc: David A. Wheeler, git

Jacob Keller <jacob.keller@gmail.com> 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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13 17:02   ` Junio C Hamano
@ 2017-12-13 18:46     ` David A. Wheeler
  0 siblings, 0 replies; 15+ messages in thread
From: David A. Wheeler @ 2017-12-13 18:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jacob Keller, git

On Wed, 13 Dec 2017 09:02:42 -0800, Junio C Hamano <gitster@pobox.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13 12:54     ` Ævar Arnfjörð Bjarmason
@ 2017-12-14 17:48       ` David A. Wheeler
  2017-12-14 17:55         ` Ævar Arnfjörð Bjarmason
  2017-12-14 18:08       ` Junio C Hamano
  1 sibling, 1 reply; 15+ messages in thread
From: David A. Wheeler @ 2017-12-14 17:48 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jacob Keller, git

On December 13, 2017 7:54:04 AM EST, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-14 17:48       ` David A. Wheeler
@ 2017-12-14 17:55         ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 15+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-12-14 17:55 UTC (permalink / raw)
  To: David A. Wheeler; +Cc: Jacob Keller, git, Junio C Hamano


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

> On December 13, 2017 7:54:04 AM EST, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> 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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-13 12:54     ` Ævar Arnfjörð Bjarmason
  2017-12-14 17:48       ` David A. Wheeler
@ 2017-12-14 18:08       ` Junio C Hamano
  2017-12-14 18:24         ` Stefan Beller
  1 sibling, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2017-12-14 18:08 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: David A. Wheeler, Jacob Keller, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Wed, Dec 13, 2017 at 6:46 AM, David A. Wheeler <dwheeler@dwheeler.com> wrote:
>> On December 13, 2017 12:40:12 AM EST, Jacob Keller <jacob.keller@gmail.com> 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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-14 18:08       ` Junio C Hamano
@ 2017-12-14 18:24         ` Stefan Beller
  2017-12-14 18:50           ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Beller @ 2017-12-14 18:24 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Ævar Arnfjörð Bjarmason, David A. Wheeler,
	Jacob Keller, git

On Thu, Dec 14, 2017 at 10:08 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Wed, Dec 13, 2017 at 6:46 AM, David A. Wheeler <dwheeler@dwheeler.com> wrote:
>>> On December 13, 2017 12:40:12 AM EST, Jacob Keller <jacob.keller@gmail.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-14 18:24         ` Stefan Beller
@ 2017-12-14 18:50           ` Junio C Hamano
  2017-12-14 19:05             ` David A. Wheeler
  2017-12-14 19:41             ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 15+ messages in thread
From: Junio C Hamano @ 2017-12-14 18:50 UTC (permalink / raw)
  To: Stefan Beller
  Cc: Ævar Arnfjörð Bjarmason, David A. Wheeler,
	Jacob Keller, git

Stefan Beller <sbeller@google.com> 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".


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-14 18:50           ` Junio C Hamano
@ 2017-12-14 19:05             ` David A. Wheeler
  2017-12-14 19:40               ` Junio C Hamano
  2017-12-14 19:41             ` Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 15+ messages in thread
From: David A. Wheeler @ 2017-12-14 19:05 UTC (permalink / raw)
  To: Junio C Hamano, Stefan Beller
  Cc: Ævar Arnfjörð Bjarmason, Jacob Keller, git

On December 14, 2017 1:50:00 PM EST, Junio C Hamano <gitster@pobox.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-14 19:05             ` David A. Wheeler
@ 2017-12-14 19:40               ` Junio C Hamano
       [not found]                 ` <E1ePark-0008P4-Qx@rmmprod07.runbox>
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2017-12-14 19:40 UTC (permalink / raw)
  To: David A. Wheeler
  Cc: Stefan Beller, Ævar Arnfjörð Bjarmason, Jacob Keller, git

"David A. Wheeler" <dwheeler@dwheeler.com> writes:

> On December 14, 2017 1:50:00 PM EST, Junio C Hamano <gitster@pobox.com> 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).


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
  2017-12-14 18:50           ` Junio C Hamano
  2017-12-14 19:05             ` David A. Wheeler
@ 2017-12-14 19:41             ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 15+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-12-14 19:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Stefan Beller, David A. Wheeler, Jacob Keller, git


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

> Stefan Beller <sbeller@google.com> 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".

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] doc: Modify git-add doc to say "staging area"
       [not found]                 ` <E1ePark-0008P4-Qx@rmmprod07.runbox>
@ 2017-12-14 21:28                   ` Stefan Beller
  0 siblings, 0 replies; 15+ messages in thread
From: Stefan Beller @ 2017-12-14 21:28 UTC (permalink / raw)
  To: David A. Wheeler
  Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason,
	Jacob Keller, git

On Thu, Dec 14, 2017 at 1:16 PM, David A. Wheeler <dwheeler@dwheeler.com> wrote:
> "David A. Wheeler" <dwheeler@dwheeler.com> 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 <gitster@pobox.com> 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 <schacon@gmail.com>
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 <schacon@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-12-14 21:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13  2:32 [PATCH] doc: Modify git-add doc to say "staging area" David A. Wheeler
2017-12-13  5:40 ` Jacob Keller
2017-12-13  5:46   ` David A. Wheeler
2017-12-13 12:54     ` Ævar Arnfjörð Bjarmason
2017-12-14 17:48       ` David A. Wheeler
2017-12-14 17:55         ` Ævar Arnfjörð Bjarmason
2017-12-14 18:08       ` Junio C Hamano
2017-12-14 18:24         ` Stefan Beller
2017-12-14 18:50           ` Junio C Hamano
2017-12-14 19:05             ` David A. Wheeler
2017-12-14 19:40               ` Junio C Hamano
     [not found]                 ` <E1ePark-0008P4-Qx@rmmprod07.runbox>
2017-12-14 21:28                   ` Stefan Beller
2017-12-14 19:41             ` Ævar Arnfjörð Bjarmason
2017-12-13 17:02   ` Junio C Hamano
2017-12-13 18:46     ` David A. Wheeler

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).