git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* friendlier names
@ 2009-01-27 15:30 David Abrahams
  2009-01-27 15:33 ` Felipe Contreras
  2009-01-27 15:38 ` Shawn O. Pearce
  0 siblings, 2 replies; 10+ messages in thread
From: David Abrahams @ 2009-01-27 15:30 UTC (permalink / raw)
  To: git


I'm absolutely certain I'm not the first person to have raised this
issue, so feel free to point me at the threads where I can get the
rationale... but: to me it looks like git's choice of terminology hurts
its adoption and learnability.  

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.

Thanks,

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 15:30 friendlier names David Abrahams
@ 2009-01-27 15:33 ` Felipe Contreras
  2009-01-27 15:38 ` Shawn O. Pearce
  1 sibling, 0 replies; 10+ messages in thread
From: Felipe Contreras @ 2009-01-27 15:33 UTC (permalink / raw)
  To: David Abrahams; +Cc: git

On Tue, Jan 27, 2009 at 5:30 PM, David Abrahams <dave@boostpro.com> wrote:
>
> I'm absolutely certain I'm not the first person to have raised this
> issue, so feel free to point me at the threads where I can get the
> rationale... but: to me it looks like git's choice of terminology hurts
> its adoption and learnability.
>
> 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.

+1

I think several people have mentioned it, and there have been
different possible actions, but nothing concrete AFAIK.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 15:30 friendlier names David Abrahams
  2009-01-27 15:33 ` Felipe Contreras
@ 2009-01-27 15:38 ` Shawn O. Pearce
  2009-01-27 16:40   ` David Abrahams
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Shawn O. Pearce @ 2009-01-27 15:38 UTC (permalink / raw)
  To: David Abrahams; +Cc: git

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 15:38 ` Shawn O. Pearce
@ 2009-01-27 16:40   ` David Abrahams
  2009-01-27 18:10   ` Johannes Schindelin
  2009-01-27 18:28   ` Junio C Hamano
  2 siblings, 0 replies; 10+ messages in thread
From: David Abrahams @ 2009-01-27 16:40 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git


on Tue Jan 27 2009, "Shawn O. Pearce" <spearce-AT-spearce.org> wrote:

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

I'm not saying "index" doesn't make sense.  It _still_ makes sense.  It
just doesn't make as much sense as "stage."  Index is a very generic
term; it doesn't communicate enough.

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

Sounds like, from everything you've said, "stage" rather than "index"
would have been just as sensible in the beginning as it is today; it's
just that you have a much nicer interface for working with it.

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

OK, thanks for the history lesson.  It's good to know someone is paying
attention to these things.  Is there any movement toward addressing
them outside of GitTogether talk?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 15:38 ` Shawn O. Pearce
  2009-01-27 16:40   ` David Abrahams
@ 2009-01-27 18:10   ` Johannes Schindelin
  2009-01-27 18:28   ` Junio C Hamano
  2 siblings, 0 replies; 10+ messages in thread
From: Johannes Schindelin @ 2009-01-27 18:10 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: David Abrahams, git

Hi,

On Tue, 27 Jan 2009, Shawn O. Pearce wrote:

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

Actually, it was known by the name "dircache" back then :-)

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 15:38 ` Shawn O. Pearce
  2009-01-27 16:40   ` David Abrahams
  2009-01-27 18:10   ` Johannes Schindelin
@ 2009-01-27 18:28   ` Junio C Hamano
  2009-01-27 19:17     ` Jakub Narebski
  2 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2009-01-27 18:28 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: David Abrahams, git

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

This part is a bit misleading, if not completely incorrect.

Since day 1, the entity we now call "the index aka staging area" has been
just that.  It was originally called "cache" and it implemented a cache of
_contents_ that are meant to go in the tree the next commit records.  It
was renamed to the "index" because it is an index, which you can consult
with a pathname as the key to get to the _contents_ as its value.

It never was "list of pathnames" without _contents_.  So it was a staging
area from day one.

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.

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

Yeah, you may have to consider the possibility that that particular
training lingo is inconsistent with the rest of the system, exactly
because it came from outside.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 18:28   ` Junio C Hamano
@ 2009-01-27 19:17     ` Jakub Narebski
  2009-01-27 19:50       ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2009-01-27 19:17 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Shawn O. Pearce, David Abrahams, git

Junio C Hamano <gitster@pobox.com> writes:
> "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...

[...]
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 19:17     ` Jakub Narebski
@ 2009-01-27 19:50       ` Junio C Hamano
  2009-01-28  2:12         ` Jakub Narebski
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2009-01-27 19:50 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Shawn O. Pearce, David Abrahams, git

Jakub Narebski <jnareb@gmail.com> writes:

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

I do not think so.

People who are taught with various means (including "git stage" alias)
understand that you prepare the contents you want to record in the commit
you are about to make by updating the contents registered in the index aka
staging area, then you do not need "git resolved".

You resolve, you have the desired content in your work tree, and you
register the updated contents from your work tree to the index aka staging
area, in exactly the same way as you do when you want to include updated
contents for any commit.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-27 19:50       ` Junio C Hamano
@ 2009-01-28  2:12         ` Jakub Narebski
  2009-01-28  4:51           ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2009-01-28  2:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Shawn O. Pearce, David Abrahams, git

Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > 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).
> 
> I do not think so.
> 
> People who are taught with various means (including "git stage" alias)
> understand that you prepare the contents you want to record in the commit
> you are about to make by updating the contents registered in the index aka
> staging area, then you do not need "git resolved".

"Who are taught". This makes for Git to be more "user selective".
Not that this matter much, as world domination is not our goal ;-)
 
> You resolve, you have the desired content in your work tree, and you
> register the updated contents from your work tree to the index aka staging
> area, in exactly the same way as you do when you want to include updated
> contents for any commit.

While I don't think that "git resolved" is something really needed,
the difference is with "git add ." and "git resolved ." and between
"git add *" and "git resolved *", where the latter would update only
resolved merge conflict resolutions, and would not pick up independent
changes to the files that were not in conflict.

BTW with "git add" way you have to know that "git add"-ing a file
would clear 'is in merge conflict' flags (well, will hide >0 stages...).

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: friendlier names
  2009-01-28  2:12         ` Jakub Narebski
@ 2009-01-28  4:51           ` Junio C Hamano
  0 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2009-01-28  4:51 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Shawn O. Pearce, David Abrahams, git

Jakub Narebski <jnareb@gmail.com> writes:

> BTW with "git add" way you have to know that "git add"-ing a file
> would clear 'is in merge conflict' flags (well, will hide >0 stages...).

Sigh...

Again, you seem to be affected by the same confusion that caused you to
think "git resolved" may have some reason to exist.

An unmerged index with higer stages means that the contents that need to
be in the next commit is _unknown_ for the paths.

If somebody says "I am telling you that this path has the contents I want
to have in the commit I will create next" (which is what "staging" the
contents in the "index" is), what plausible reason does git have to keep
the higher stages for them?  At that point, the contents the user wants to
have for these paths are known.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-01-28  4:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-27 15:30 friendlier names David Abrahams
2009-01-27 15:33 ` Felipe Contreras
2009-01-27 15:38 ` Shawn O. Pearce
2009-01-27 16:40   ` David Abrahams
2009-01-27 18:10   ` Johannes Schindelin
2009-01-27 18:28   ` Junio C Hamano
2009-01-27 19:17     ` Jakub Narebski
2009-01-27 19:50       ` Junio C Hamano
2009-01-28  2:12         ` Jakub Narebski
2009-01-28  4:51           ` Junio C Hamano

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 NNTP newsgroup(s).