# Why git shows staging area to users?

6 messages from 2012-10-13 to 2012-10-14. Participants: Yi, EungJun, Felipe Contreras, David Aguilar, Sitaram Chamarty, Junio C Hamano, Matthieu Moy.
Thread: https://gitlist.dev/t/31804

## Yi, EungJun, 2012-10-13 21:08

Subject: Why git shows staging area to users?
Message-ID: <CAFT+Tg-g6KOs3YUKV_GWbZiO9qUG3LP8-T3Tdyd3LinnheQZ8A@mail.gmail.com>
URL: https://gitlist.dev/e/CAFT%2BTg-g6KOs3YUKV_GWbZiO9qUG3LP8-T3Tdyd3LinnheQZ8A%40mail.gmail.com

```
Hi, all.

Why git shows staging area to users, compared with the other scms hide
it? What benefits users get?

I feel staging area is useful, but it is difficult to explain why when
someone asks me about that.

Thanks.

```

## Felipe Contreras, 2012-10-14 00:06

Subject: Re: Why git shows staging area to users?
Message-ID: <CAMP44s2d_3rciA2QTy5vn0yNXEER90-y1Q_x8sn7+2mVJ2eoBA@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s2d_3rciA2QTy5vn0yNXEER90-y1Q_x8sn7%2B2mVJ2eoBA%40mail.gmail.com
In-Reply-To: <CAFT+Tg-g6KOs3YUKV_GWbZiO9qUG3LP8-T3Tdyd3LinnheQZ8A@mail.gmail.com>

```
On Sat, Oct 13, 2012 at 11:08 PM, Yi, EungJun <semtlenori@gmail.com> wrote:
> I feel staging area is useful, but it is difficult to explain why when
> someone asks me about that.

I agree. There has been a lot of discussions about how to improve the
UI to make it more user-friendly. Maybe sometime.

-- 
Felipe Contreras

```

## David Aguilar, 2012-10-14 00:56

Subject: Re: Why git shows staging area to users?
Message-ID: <CAJDDKr7tUJ59jYDM-jhFnGMEB18taT7FsTJ24Hr=iBUgXXeYdg@mail.gmail.com>
URL: https://gitlist.dev/e/CAJDDKr7tUJ59jYDM-jhFnGMEB18taT7FsTJ24Hr%3DiBUgXXeYdg%40mail.gmail.com
In-Reply-To: <CAFT+Tg-g6KOs3YUKV_GWbZiO9qUG3LP8-T3Tdyd3LinnheQZ8A@mail.gmail.com>

```
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.

> I feel staging area is useful, but it is difficult to explain why when
> someone asks me about that.

See above.
-- 
David

```

## Sitaram Chamarty, 2012-10-14 02:09

Subject: Re: Why git shows staging area to users?
Message-ID: <CAMK1S_hLDabfANbjrWEF6ZND7OZkAxxpGEeKdv2-3B5pmjiU1g@mail.gmail.com>
URL: https://gitlist.dev/e/CAMK1S_hLDabfANbjrWEF6ZND7OZkAxxpGEeKdv2-3B5pmjiU1g%40mail.gmail.com
In-Reply-To: <CAFT+Tg-g6KOs3YUKV_GWbZiO9qUG3LP8-T3Tdyd3LinnheQZ8A@mail.gmail.com>

```
On Sun, Oct 14, 2012 at 2:38 AM, 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?
>
> I feel staging area is useful, but it is difficult to explain why when
> someone asks me about that.

I wrote this a long time ago, more for my understanding than
otherwise, but maybe it is useful:
http://sitaramc.github.com/concepts/uses-of-index.html

```

## Junio C Hamano, 2012-10-14 04:38

Subject: Re: Why git shows staging area to users?
Message-ID: <7vtxtx1xe8.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vtxtx1xe8.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CAJDDKr7tUJ59jYDM-jhFnGMEB18taT7FsTJ24Hr=iBUgXXeYdg@mail.gmail.com>

```
David Aguilar <davvid@gmail.com> writes:

> 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.
>
>> I feel staging area is useful, but it is difficult to explain why when
>> someone asks me about that.
>
> See above.

Very well said.  Thanks.

```

## Matthieu Moy, 2012-10-14 17:16

Subject: Re: Why git shows staging area to users?
Message-ID: <vpqr4p1as8l.fsf@grenoble-inp.fr>
URL: https://gitlist.dev/e/vpqr4p1as8l.fsf%40grenoble-inp.fr
In-Reply-To: <CAJDDKr7tUJ59jYDM-jhFnGMEB18taT7FsTJ24Hr=iBUgXXeYdg@mail.gmail.com>

```
David Aguilar <davvid@gmail.com> writes:

> 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/

```
