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

Re: Why git shows staging area to users?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Oct 14, 2012, 17:16 UTC
Message-ID
<vpqr4p1as8l.fsf@grenoble-inp.fr>
In-Reply-To
<CAJDDKr7tUJ59jYDM-jhFnGMEB18taT7FsTJ24Hr=iBUgXXeYdg@mail.gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 11 quoted lines
> On Sat, Oct 13, 2012 at 2:08 PM, Yi, EungJun <semtlenori@gmail.com> wrote:
>> Hi, all.
>>
>> Why git shows staging area to users, compared with the other scms hide
>> it? What benefits users get?
>
> http://thkoch2001.github.com/whygitisbetter/#the-staging-area
> http://tomayko.com/writings/the-thing-about-git
> http://gitready.com/beginner/2009/01/18/the-staging-area.html
>
> Other scms do not "hide"; other scms lack this feature altogether.

More precisely: there are several things in what git calls "the index" or "the staging area" (i.e. .git/index):

1) a list of files tracked by Git
2) a record of the last known meta-data of the file, used to avoid
   re-reading unmodified files content each time one runs "diff",
   "commit" or so.
3) a record of the file's staged *content* (possible several records in
   case a merge is going on)
Any decent revision control has the equivalent of 1) and 2), but AFAIK,
3) is a unique feature of Git. There is a frequent confusion between 2)
and 3) that leads to people (often other revision-control
users/developers) wonder why this is visible to the user. 2) is a
performance optimization that can be hidden to the user (it is with
Git's porcelain commands), but 3) is user-visible.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Sitaram Chamarty
Message 5 of 6 in “Why git shows staging area to users?”
  1. Yi, EungJunOct 13, 2012
  2. Felipe ContrerasOct 14, 2012
  3. David AguilarOct 14, 2012
  4. Junio C HamanoOct 14, 2012
  5. Matthieu MoyOct 14, 2012
  6. Sitaram ChamartyOct 14, 2012

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.