Re: [1.8.0] use 'stage' term consistently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just a few factoid corrections.

Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:

>> Actually Git porcelain does use 'the index' as a cache (computing),
>> i.e. as a place to store redundant information (stat data, sha-1
>> for trees with DIRC dircache extension) for faster access.
>
> This is an implementation optimization, that is not supposed to be
> visible for the user. Commands refering to the "cache" are not about
> stat data cache (e.g. "git diff --cached" is really about the content,
> not the stat cache).

Yes. It has been pointed out number of times that "--cached" option is
misnamed and deserves a better name, perhaps "--index-only", with the
current name kept as a backward compatibility synonym.

>> Actually 'the index' is index in that sense; it stores _references_
>> from filename to file contents,...

Correct. It is the table-of-contents for whatever tree the next
"write-tree" would write out.  But it also was named "cache" originally
because that it is not a huge loss if you lose it; you can repopulate it
from the working tree. Over time, the operation you can do to the "index"
became richer and finer grained, mostly thanks to "add -p" family of
features, so it no longer is "not a big deal" to lose the distinction
between what has and has not yet been added to the index (iow, "git reset"
without any options), and the reason to consider it "cache" has diminished.

Contrary to the popular belief by outsiders, i.e. what you wrote at the
end of the message I left below, the "stat cache" part was not the primary
origin of the name "dircache".

> ...
> Because we sometimes call it "cache", they think it is basically a
> stat-cache, and wonder why it is shown to the user. I've even seen
> Git users think that others VCS didn't have a stat-cache because they
> had read that the "cache" was a unique Git feature.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]