git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: David Aguilar <davvid@gmail.com>
Cc: semtlenori@gmail.com, git@vger.kernel.org
Subject: Re: Why git shows staging area to users?
Date: Sun, 14 Oct 2012 19:16:58 +0200	[thread overview]
Message-ID: <vpqr4p1as8l.fsf@grenoble-inp.fr> (raw)
In-Reply-To: <CAJDDKr7tUJ59jYDM-jhFnGMEB18taT7FsTJ24Hr=iBUgXXeYdg@mail.gmail.com> (David Aguilar's message of "Sat, 13 Oct 2012 17:56:39 -0700")

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/

  parent reply	other threads:[~2012-10-14 17:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 21:08 Why git shows staging area to users? Yi, EungJun
2012-10-14  0:06 ` Felipe Contreras
2012-10-14  0:56 ` David Aguilar
2012-10-14  4:38   ` Junio C Hamano
2012-10-14 17:16   ` Matthieu Moy [this message]
2012-10-14  2:09 ` Sitaram Chamarty

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqr4p1as8l.fsf@grenoble-inp.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=semtlenori@gmail.com \
    /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.
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).