git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why isn't the index a tree?
@ 2011-08-19 21:24 Richard Hansen
  2011-08-19 23:05 ` Jon Seymour
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Hansen @ 2011-08-19 21:24 UTC (permalink / raw)
  To: git

I expected the index to be implemented something like a ref to a tree 
object (per stage) plus some stat()/assume-unchanged/etc. metadata. 
Instead, it appears to be a (sorted?) flat list of full paths with their 
associated SHA1s and metadata.

Is there a reason why each stage in the index isn't implemented as a tree?

If the index was a tree, I believe it would make several tasks easier:
   * you could easily get the diff between stage 1 and some arbitrary 
revision (e.g., git diff HEAD^^ :1:)
   * you could commit and checkout empty directories
   * you could use update-index --cacheinfo to directly insert/replace 
an entire subdirectory
   * etc.

Thanks,
Richard

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

end of thread, other threads:[~2011-08-19 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-19 21:24 Why isn't the index a tree? Richard Hansen
2011-08-19 23:05 ` Jon Seymour

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