From: Richard Hansen <rhansen@bbn.com>
To: git@vger.kernel.org
Subject: Why isn't the index a tree?
Date: Fri, 19 Aug 2011 17:24:44 -0400 [thread overview]
Message-ID: <4E4ED49C.6050405@bbn.com> (raw)
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
next reply other threads:[~2011-08-19 21:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 21:24 Richard Hansen [this message]
2011-08-19 23:05 ` Why isn't the index a tree? Jon Seymour
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=4E4ED49C.6050405@bbn.com \
--to=rhansen@bbn.com \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.