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

Re: friendlier names

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 27, 2009, 19:17 UTC
Message-ID
<m37i4gy2z6.fsf@localhost.localdomain>
In-Reply-To
<7vwscgy56b.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
>> 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...
[...]
Show 15 quoted lines
> The way to update the cache was called "update-cache" then "update-index".
> Because it usually is much rare to actually add a new entry to the index
> than updating an existing entry in the index, the command had a safeguard
> against "update-cache a-newfile" without explicit request from the user to
> say "oh by the way I know I am adding new entries".  "git add" came much
> later to give you a shorthand for "update-index --add".  Updating existing
> entries in the index was still done with "update-index".
> 
> Later Nico taught (after much discussion) "git add" to also serve as
> "update-index" for existing entries in the index.
> 
> We could have called it "git update-index" when we did that switch-over,
> because the operation is exactly that --- updating the index.
> 
> But the name somehow stuck.
[...]

It is a bit of pity that "git add" was overloaded to also add new contents and not only add new file (and its contents!), instead of having new command "git stage" to be porcelain version of "git update-index" porcelain. And perhaps "git resolved" to only mark resolved entries (so e.g. "git resolved ." would not add new files, nor add new contents of files which were not in conflict).

Now we have to explain that "git add" adds new contents... OTOH it is perhaps good idea to emphasize differences between Git and other lesser^W SCMs. ;-) And introduce "git add -N"...

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.