git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2017, 17:02 UTC
Message-ID
<xmqq8te6y30t.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CA+P7+xrWFE+6t-Z8cGQX5WtZP1_EQSa+J7vF65dLDSOnLfFxXQ@mail.gmail.com>
Jacob Keller <jacob.keller@gmail.com> writes:
Show 6 quoted lines
> 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.

Previous: Ævar Arnfjörð BjarmasonNext: David A. Wheeler
Message 13 of 15 in “doc: Modify git-add doc to say "staging area"”
  1. doc: Modify git-add doc to say "staging area"David A. Wheeler, Dec 13, 2017
  2. Jacob KellerDec 13, 2017
  3. David A. WheelerDec 13, 2017
  4. Ævar Arnfjörð BjarmasonDec 13, 2017
  5. David A. WheelerDec 14, 2017
  6. Ævar Arnfjörð BjarmasonDec 14, 2017
  7. Junio C HamanoDec 14, 2017
  8. Stefan BellerDec 14, 2017
  9. Junio C HamanoDec 14, 2017
  10. David A. WheelerDec 14, 2017
  11. Junio C HamanoDec 14, 2017
  12. Ævar Arnfjörð BjarmasonDec 14, 2017
  13. Junio C HamanoDec 13, 2017
  14. David A. WheelerDec 13, 2017
  15. Stefan BellerDec 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.