git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [FAQ?] Rationale for git's way to manage the index
@ 2007-05-06 16:10 Matthieu Moy
  2007-05-06 16:51 ` Johannes Schindelin
                   ` (2 more replies)
  0 siblings, 3 replies; 71+ messages in thread
From: Matthieu Moy @ 2007-05-06 16:10 UTC (permalink / raw)
  To: git

Hi,

I've read the manual, and I belive I have a correct understanding of
how the index works, technically speaking. Still, I'm not clear about
the rational for such design.

Almost any other decent system has an equivalent to cache the stat
information (bzr calls this stat-cache, hg calls it dirstate IIRC).
That is, if your run "$vcs diff" twice, the second run will only need
to stat all files, never diff them.

But the fact that git actually remembers the _content_ of files in the
index, and that the default behavior for "commit" is to commit only
the content that is explicitely "git add"ed is something I've never
seen outside git.

At first, I find it rather annoying. My usual workflow is

<hack hack hack>
% $vcs status
% $vcs commit -m "describe whatever I did"
<hack hack hack>
...

With git, i'd do

<hack hack hack>
% git status
% git add X
% git add Y
% git status
% git commit

or

<hack hack hack>
% git satus -a
% git commit -a -m "..."

In the former case, I have more commands to type, and in the second
case, I loose part of the stat-cache benefit: If I run "git status -a"
twice, the second run will actually diff all the files touched since
the last run, since "git status -a" actually updated a temporary
index, and discarded it afterwards, so it doesn't update the stat
information in the index (while "git status" would have).

In both cases, I can't really see the benefit. I'm pretty sure this is
a FAQ, and I'm also pretty sure there are good arguments for it, but I
can't find it anywhere.

Thanks for your answers,

-- 
Matthieu

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

end of thread, other threads:[~2007-05-15 23:27 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-06 16:10 [FAQ?] Rationale for git's way to manage the index Matthieu Moy
2007-05-06 16:51 ` Johannes Schindelin
2007-05-06 17:34   ` Matthieu Moy
2007-05-06 17:43     ` Junio C Hamano
2007-05-09 12:52       ` Petr Baudis
2007-05-09 13:57         ` Johannes Schindelin
2007-05-09 14:24           ` [PATCH] git-commit: Reformat log messages provided on commandline Petr Baudis
2007-05-09 14:59             ` Matthieu Moy
2007-05-09 15:11               ` Petr Baudis
2007-05-09 15:32                 ` Matthieu Moy
2007-05-09 15:01             ` Johannes Schindelin
2007-05-10  0:45             ` Junio C Hamano
2007-05-12  0:25               ` Jakub Narebski
2007-05-06 18:22     ` [FAQ?] Rationale for git's way to manage the index Dana How
2007-05-06 23:42     ` Johannes Schindelin
2007-05-06 17:25 ` Linus Torvalds
2007-05-06 18:23   ` Matthieu Moy
2007-05-06 19:54     ` Linus Torvalds
2007-05-06 22:53     ` Julian Phillips
2007-05-07  6:35       ` Karl Hasselström
2007-05-08  1:41         ` Shawn O. Pearce
2007-05-08  7:15           ` Johannes Sixt
2007-05-08 10:28             ` Karl Hasselström
2007-05-08 12:40               ` J. Bruce Fields
2007-05-08 14:53                 ` Karl Hasselström
2007-05-09  3:45                   ` J. Bruce Fields
2007-05-09  9:40                     ` Johannes Schindelin
2007-05-08  7:37           ` Karl Hasselström
2007-05-08 14:52             ` Shawn O. Pearce
2007-05-06 23:51     ` Johannes Schindelin
2007-05-07  8:02       ` Matthieu Moy
2007-05-07 11:05         ` Johannes Schindelin
2007-05-09 13:07           ` Petr Baudis
2007-05-08  3:16     ` Martin Langhoff
2007-05-08  4:45       ` Linus Torvalds
2007-05-08  5:35         ` Martin Langhoff
2007-05-09 13:41         ` Petr Baudis
2007-05-09 15:52           ` Linus Torvalds
2007-05-09 16:29             ` Carl Worth
2007-05-11  1:28               ` Jakub Narebski
     [not found]                 ` <7vd518gkyo.fsf@assigned-by-dhcp.cox.net>
2007-05-11 11:26                   ` Jakub Narebski
2007-05-11 16:45                     ` Junio C Hamano
2007-05-11 23:06                       ` Jakub Narebski
2007-05-12  0:40                         ` Junio C Hamano
2007-05-12  1:06                           ` Jakub Narebski
2007-05-12  9:35                           ` Jakub Narebski
2007-05-09 16:33             ` Dana How
2007-05-09 17:18               ` J. Bruce Fields
2007-05-09 17:26                 ` Petr Baudis
2007-05-09 17:29                   ` J. Bruce Fields
2007-05-09 17:39             ` Daniel Barkalow
2007-05-09 18:16               ` Linus Torvalds
2007-05-10  0:31             ` Junio C Hamano
2007-05-10  2:27               ` Steven Grimm
2007-05-10  2:39                 ` Linus Torvalds
2007-05-10  8:00                   ` Matthieu Moy
2007-05-10 22:06               ` Shawn O. Pearce
2007-05-10 22:51                 ` Petr Baudis
2007-05-08 11:07       ` Johannes Schindelin
2007-05-15  1:00         ` David Kågedal
2007-05-15 23:27           ` Johannes Schindelin
2007-05-09 17:18     ` Matthieu Moy
2007-05-07 11:40 ` Guilhem Bonnefille
2007-05-07 12:16   ` Karl Hasselström
2007-05-07 12:36     ` David Kastrup
2007-05-07 12:55   ` Johannes Schindelin
2007-05-07 19:31     ` Junio C Hamano
2007-05-09 13:14     ` Petr Baudis
2007-05-07 22:23   ` Daniel Barkalow
2007-05-15  0:57   ` David Kågedal
2007-05-15  8:29     ` Karl Hasselström

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