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

Re: friendlier names

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 27, 2009, 15:38 UTC
Message-ID
<20090127153837.GB1321@spearce.org>
In-Reply-To
<87mydc6a2r.fsf@mcbain.luannocracy.com>
David Abrahams <dave@boostpro.com> wrote:
> 
> For example, why couldn't the "index" be called the "stage" instead?
> That, along with knowing that "git add" was a synonym for "git stage"
> would have flattened the learning curve considerably for me.
Historical reasons...

Waaay back the "index" was an index of the files git knows about in your working directory. It made sense to call it an index, as like a book index it was a full listing of what's here, sorted by name.

That's pre-1.0 days. Like the very first version Linus ever released. Aka commit e83c5163316f89bfbde7d9ab23ca2e25604af290.

Much, much later, over many months, the index morphed into what you see today, which is a "staging area", accessed by "git add".

This was all incremental, in small parts. Nobody set out to design a "staging area" or to have "staging actions". Back when it was really the index you updated it with a tool called git-update-index. Adding new files required the --add flag.

People found --add annoying, so they wrote "git add" as a wrapper around it. But modified existing files still had to be updated with git-update-index. Then someone pointed out that add of an existing file and add of a new file are similiar enough that they should just be the same command, "git add".

Only late last October at the GitTogether did we start to talk about creating a command called "git stage", because people have started to realize we seem to call it a "staging area" as we train newcomers...

The tools are _all_ slowly evolved over time. Nothing in git was ever set out from the beginning as a "this is what we are going to do". The only part of Git that is like that is the core data structure on disk for the object store. That hasn't changed since Linus switched from SHA1(COMPRESS(data)) to SHA1(data) for the object naming algorithm, and even that was done in the first couple of weeks.

-- 
Shawn.
Previous: Felipe ContrerasNext: David Abrahams
Message 3 of 10 in “friendlier names”
  1. David AbrahamsJan 27, 2009
  2. Felipe ContrerasJan 27, 2009
  3. Shawn O. PearceJan 27, 2009
  4. David AbrahamsJan 27, 2009
  5. Johannes SchindelinJan 27, 2009
  6. Junio C HamanoJan 27, 2009
  7. Jakub NarebskiJan 27, 2009
  8. Junio C HamanoJan 27, 2009
  9. Jakub NarebskiJan 28, 2009
  10. Junio C HamanoJan 28, 2009

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.