git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Chris Torek" <chris.torek@gmail.com>,
	"D. Ben Knoble" <ben.knoble@gmail.com>,
	"Jean-Noël AVILA" <jn.avila@free.fr>,
	"Julia Evans" <julia@jvns.ca>
Subject: Re: [PATCH v2 4/4] doc: git-add: explain inconsistent terminology
Date: Thu, 14 Aug 2025 15:49:14 -0700	[thread overview]
Message-ID: <xmqqldnlwmc5.fsf@gitster.g> (raw)
In-Reply-To: <9e595f9ad59776d74a431731824410c7b73795dd.1755127218.git.gitgitgadget@gmail.com> (Julia Evans via GitGitGadget's message of "Wed, 13 Aug 2025 23:20:18 +0000")

"Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Julia Evans <julia@jvns.ca>
>
> I think the fact that git uses these three terms interchangeably is
> extremely confusing and that it deserves to be noted.

We tend to avoid saying "I think" in our proposed log messages, as
we do not churn the code and documentation merely to match personal
preferences.

I do not necessarily think "git add --help" is an appropriate place
to leave this note, by the way.  We should start from teaching "git
help glossary", which does not mention "staging area" at all, which
is a sign that it is somewhat outdated.  It does not use the verb
'to stage' even once, either.

Here is my attempt to improve the situation by giving a definition
of "staging area" in the glossary.  Luckily, "cache" already has its
own entry, describing it as an old synonym to the 'index', so I
didn't have to do anything there.  Also the description of 'index'
has a bit too much implementation detail, which I toned down.

---
Subject: glossary: talk about "staging area"

Surprisingly, "git help glossary" does not mention the 'staging
area' synonym for the index, or the verb 'to stage'.  As "git
status" output uses the latter (i.e. "Changes not staged for
commit"), we should not leave it undefined what the verb means.

Rewrite the definition of the `index` somewhat to reduce the level
of implementation detail exposed, and focus more on the fact that it
is a mapping from pathnames to the contents at these paths.  And
mention the `staging area` there, as well as giving its own glossary
entry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/glossary-content.adoc | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git c/Documentation/glossary-content.adoc w/Documentation/glossary-content.adoc
index e423e4765b..10f0c21e88 100644
--- c/Documentation/glossary-content.adoc
+++ w/Documentation/glossary-content.adoc
@@ -247,11 +247,15 @@ for a more flexible and robust system to do the same thing.
 	of Git you had to make them executable.
 
 [[def_index]]index::
-	A collection of files with stat information, whose contents are stored
-	as objects. The index is a stored version of your
-	<<def_working_tree,working tree>>. Truth be told, it can also contain a second, and even
-	a third version of a working tree, which are used
-	when <<def_merge,merging>>.
+	The index stores the mapping from filenames to their contents
+	to prepare the contents of the next commit by updating the
+	object recorded for each path (for this reason, people often
+	say that the index is "like the staging area" when explaining
+	the concept), together with other information to detect which
+	working tree files are modified efficiently.
+	During a conflicted <<def_merge,merge>>, the index can have
+	multiple versions of contents at higher stages for the same
+	path.
 
 [[def_index_entry]]index entry::
 	The information regarding a particular file, stored in the
@@ -650,6 +654,12 @@ the `refs/tags/` hierarchy is used to represent local tags..
 	is created by giving the `--depth` option to linkgit:git-clone[1], and
 	its history can be later deepened with linkgit:git-fetch[1].
 
+[[def_stage]]staging area::
+	A synonym for <<def_index,index>>.  Adding contents to the
+	index to update the mapping from the filename to its contents
+	is often called "to stage" (verb), as people explain the index
+	is like a staging area to prepare for the next commit.
+
 [[def_stash]]stash entry::
 	An <<def_object,object>> used to temporarily store the contents of a
 	<<def_dirty,dirty>> working directory and the index for future reuse.

  reply	other threads:[~2025-08-14 22:49 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 20:07 [PATCH 0/5] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-12 20:07 ` [PATCH 1/5] doc: git-add: remove options from SYNOPSIS Julia Evans via GitGitGadget
2025-08-12 20:41   ` Junio C Hamano
2025-08-13 16:58     ` Julia Evans
2025-08-13 20:47   ` Jean-Noël AVILA
2025-08-12 20:07 ` [PATCH 2/5] doc: git-add: start man page with an example Julia Evans via GitGitGadget
2025-08-12 21:01   ` Junio C Hamano
2025-08-12 21:40     ` Julia Evans
2025-08-12 22:12       ` Junio C Hamano
2025-08-12 22:45         ` Julia Evans
2025-08-13 17:22       ` D. Ben Knoble
2025-08-14  0:41       ` Junio C Hamano
2025-08-14  2:59         ` Julia Evans
2025-08-15  5:38           ` Junio C Hamano
2025-08-12 20:07 ` [PATCH 3/5] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-13 17:24   ` D. Ben Knoble
2025-08-12 20:07 ` [PATCH 4/5] doc: git-add: make explanation less dry Julia Evans via GitGitGadget
2025-08-12 20:07 ` [PATCH 5/5] doc: git-add: explain inconsistent terminology Julia Evans via GitGitGadget
2025-08-12 20:51   ` Chris Torek
2025-08-12 21:36     ` Junio C Hamano
2025-08-12 21:43       ` Julia Evans
2025-08-13 23:20 ` [PATCH v2 0/4] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-13 23:20   ` [PATCH v2 1/4] doc: git-add: start man page with an example Julia Evans via GitGitGadget
2025-08-15  0:38     ` Junio C Hamano
2025-08-15 13:34       ` Jean-Noël AVILA
2025-08-15 16:33         ` Junio C Hamano
2025-08-17 18:37           ` Jean-Noël AVILA
2025-08-19 20:01             ` Julia Evans
2025-08-13 23:20   ` [PATCH v2 2/4] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-14  0:59     ` D. Ben Knoble
2025-08-14 22:10     ` Junio C Hamano
2025-08-13 23:20   ` [PATCH v2 3/4] doc: git-add: make explanation less dry Julia Evans via GitGitGadget
2025-08-14 22:22     ` Junio C Hamano
2025-08-15 16:10       ` Julia Evans
2025-08-15 18:25         ` D. Ben Knoble
2025-08-15 20:01           ` Junio C Hamano
2025-08-16 14:15             ` D. Ben Knoble
2025-08-15 19:47         ` Junio C Hamano
2025-08-19 12:57           ` Julia Evans
2025-08-21 20:36             ` Jean-Noël AVILA
2025-08-13 23:20   ` [PATCH v2 4/4] doc: git-add: explain inconsistent terminology Julia Evans via GitGitGadget
2025-08-14 22:49     ` Junio C Hamano [this message]
2025-08-19 20:09       ` Julia Evans
2025-08-19 20:46   ` [PATCH v3 0/3] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-19 20:46     ` [PATCH v3 1/3] Git 2.51 Junio C Hamano via GitGitGadget
2025-08-19 21:06       ` rsbecker
2025-08-19 21:37         ` Junio C Hamano
2025-08-19 21:44           ` D. Ben Knoble
2025-08-19 21:48             ` Julia Evans
2025-08-19 21:49           ` rsbecker
2025-08-19 20:46     ` [PATCH v3 2/3] doc: git-add: clarify intro & add an example Julia Evans via GitGitGadget
2025-08-21 20:08       ` Junio C Hamano
2025-08-22 20:37         ` Julia Evans
2025-08-19 20:46     ` [PATCH v3 3/3] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-21 20:09       ` Junio C Hamano
2025-08-29 11:55     ` [PATCH v4 0/2] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-29 11:55       ` [PATCH v4 1/2] doc: git-add: clarify intro & add an example Julia Evans via GitGitGadget
2025-08-29 11:55       ` [PATCH v4 2/2] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-29 17:11       ` [PATCH v4 0/2] doc: git-add: clarify DESCRIPTION section Junio C Hamano

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=xmqqldnlwmc5.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble@gmail.com \
    --cc=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=jn.avila@free.fr \
    --cc=julia@jvns.ca \
    /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).