git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Piotr Krukowiecki <piotr.krukowiecki.news@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: Consistent terminology: cached/staged/index
Date: Sat, 26 Feb 2011 18:46:37 -0600	[thread overview]
Message-ID: <20110227004637.GC20712@elie> (raw)
In-Reply-To: <AANLkTimyXciScc5K6ozggMHsy9YmgyOFpy6pgKBEypC9@mail.gmail.com>

Hi,

Felipe Contreras wrote:
[out of order for convenience]

> Why should the users care about the stat() information? Or how the
> merge conflicts are being tracked?

The second question is very easy to answer (depending on what "how"
means, of course).  Because people integrating changes from multiple
places need to be able to resolve a conflicted merge.

> That's plumbing, not porcelain.

I don't disagree.  The analogy is almost perfect.

And the thing is, in the real world, people know about plumbing.  They
don't care about the details, but they know there are these things
called pipes, and that water tends to flow downward, and that if one
of them freezes, it will burst.  This knowledge is useful.

Likewise, it is useful to know:

 - After you use "cp -a" to copy a repository, the first operation
   you perform is going to be slower.  The cached stat() information
   is stale.

 - Until you run "git add", there is only one copy of your data, in
   the worktree.  After you run "git add", there are two copies.
   Once you run "git commit", that second copy will last at least
   as long as your commit does.

   So there is some chance of recovery from fat-finger mistakes,
   even before a commit.

 - During a merge, you can mark your progress by collapsing index
   entries with 'git add'.  "git diff" will show the state of the
   merge.  You can read the competing versions of a file with
   "git show :2:path/to/file" and "git show :3:path/to/file".

 - Index-only operations tend to be faster, since

    (1) the cached blobs are not changing, so we can save time
        stat(2)-ing and read(2)-ing files
    (2) blobs are compressed: less I/O.  Longstanding blobs are
        in pack files: good caching and I/O patterns.

   So you can speed up your slow "git grep" by using
   "git grep --cached".

 - When scripting, you can use a temporary index file to avoid
   affecting the remembered worktree state.

But so what?  I have nothing against clearer terms.  I am just saying
that (1) we should be explaining these things somewhere and (2) a
global s/index/only one of the things the index does/ is a bad idea,
because it would make the documentation *wrong*.

> There's always resistance, but 1.8 is supposed to contain stuff as "if
> git was written from scratch".

I thought 1.8 was supposed to provide an opportunity to correct some
long-known mistakes that we had been holding back on for backward
compatibility reasons.  That doesn't mean we should forget the cost of
change.

Thanks for your work, and hope that helps.
Jonathan

  reply	other threads:[~2011-02-27  0:46 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 19:20 Consistent terminology: cached/staged/index Piotr Krukowiecki
2011-02-13 19:37 ` Jonathan Nieder
2011-02-13 22:58   ` Junio C Hamano
2011-02-14  2:05     ` Miles Bader
2011-02-14  5:57       ` Junio C Hamano
2011-02-14  6:27         ` Miles Bader
2011-02-14  6:59           ` Johannes Sixt
2011-02-14  7:07             ` Miles Bader
2011-02-14 10:42               ` Michael J Gruber
2011-02-14 11:04                 ` Miles Bader
2011-02-14 17:12                   ` Junio C Hamano
2011-02-14 22:07                     ` Miles Bader
2011-02-14 22:59                       ` Junio C Hamano
2011-02-14 23:47                         ` Miles Bader
2011-02-15  0:12                           ` Junio C Hamano
2011-02-14 13:14                 ` Nguyen Thai Ngoc Duy
2011-02-14 13:43                   ` Michael J Gruber
2011-02-14 13:57                     ` Nguyen Thai Ngoc Duy
2011-02-14 14:17                     ` Felipe Contreras
2011-02-14 14:21                       ` Nguyen Thai Ngoc Duy
2011-02-14 14:40                         ` Jakub Narebski
2011-02-14 15:24                       ` Michael J Gruber
2011-02-14 16:00                         ` Felipe Contreras
2011-02-14 16:04                           ` Michael J Gruber
2011-02-14 16:27                             ` Felipe Contreras
2011-02-14  3:09     ` Pete Harlan
2011-02-16 23:11       ` Drew Northup
2011-02-26 20:36         ` Felipe Contreras
2011-02-27 15:30           ` Drew Northup
2011-02-27 21:16       ` Aghiles
2011-02-28 20:53         ` Drew Northup
2011-02-14 22:32     ` Piotr Krukowiecki
2011-02-14 23:19       ` Jonathan Nieder
2011-02-15  8:29         ` Pete Harlan
2011-02-15  9:00           ` Jonathan Nieder
2011-02-15 18:15         ` Piotr Krukowiecki
2011-02-15 18:38           ` Jonathan Nieder
2011-02-26 21:09         ` Felipe Contreras
2011-02-26 21:51           ` Jonathan Nieder
2011-02-27  0:01             ` Miles Bader
2011-02-27  0:16             ` Felipe Contreras
2011-02-27  0:46               ` Jonathan Nieder [this message]
2011-02-27  8:15               ` Junio C Hamano
2011-02-27  8:43           ` Jeff King
2011-02-27  9:21             ` Miles Bader
2011-02-27 22:28               ` Jon Seymour
2011-02-27 23:57                 ` Junio C Hamano
2011-02-28  9:38                   ` Michael J Gruber
2011-02-27 15:34             ` Drew Northup
2011-02-28 23:03               ` Jeff King
2011-03-01  9:11                 ` David
2011-03-01  9:15                   ` Matthieu Moy
2011-03-01  9:32                     ` Alexei Sholik
2011-03-01 17:02                       ` Drew Northup
2011-03-01 17:30                         ` Alexei Sholik
2011-03-01 17:41                           ` Drew Northup
2011-03-01  9:27                   ` Alexey Feldgendler
2011-03-01 16:46                     ` Drew Northup
2011-03-04 17:18                       ` Felipe Contreras
2011-03-05  4:53                         ` Miles Bader
2011-03-05  5:00                           ` Jonathan Nieder
2011-03-06 12:44                           ` Drew Northup
     [not found]               ` <878466.93199.1298934204331.JavaMail.trustmail@mail1.terreactive.ch>
2011-03-01  8:43                 ` Victor Engmark
2011-02-27 18:46           ` Phil Hord
2011-03-01 10:29 ` Jonathan Nieder

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

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

  git send-email \
    --in-reply-to=20110227004637.GC20712@elie \
    --to=jrnieder@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=piotr.krukowiecki.news@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.
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).