From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: Jeff King <peff@peff.net>, Elijah Newren <newren@gmail.com>,
git mailing list <git@vger.kernel.org>
Subject: Re: git reset for index restoration?
Date: Thu, 22 May 2014 15:18:23 -0700 [thread overview]
Message-ID: <xmqq1tvlmp8w.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqq61kxmphw.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Thu, 22 May 2014 15:12:59 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> David Turner <dturner@twopensource.com> writes:
>
>>> Yes. As I said, that should not usually be a problem for those who
>>> do the real work (read: commit), at which time write-tree will fully
>>> populate the cache-tree.
>>
>> Git commit does not in fact populate the cache-tree.
>
> If that is the case, we must have broken the write-tree codepath
> over time.
>
> Of course, "git commit foo" will need to prepare a temporary index
> where only the entry "foo" is different from the HEAD version, write
> the tree to create a commit, but we do not write out the main index
> as a tree after updating the same entry "foo" in it (there may be
> other changes relative to HEAD), so its cache-tree is only
> invalidated at "foo" when we updating the entry and we do not spend
> extra cycles to repopulate it.
>
> But at least my understanding has been that "git commit" (no partial
> commit, write the whole index as a commit) which uses the "git
> write-tree" machinery knows which subtree has what tree object name
> and populates the cache-tree fully.
... and the "incrementally repair" Peff talks about would be to
cover more cases where we may know (either because we have already
computed it to write out a subtree, or we have just read from a
known tree to populate a part of the index and we know the paths in
the index that correspond to that subtree are exactly the same ones
as found in the tree we read from) parts of the cache-tree can be
updated with tree object names for subtrees, but we don't do
anything right now. "git commit foo" (where "foo" is a directory)
may be able to say "The cache-tree entry for 'foo' can be updated
with the tree object of the new HEAD:foo because we know they must
match in the main index", for example.
next prev parent reply other threads:[~2014-05-22 22:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 16:22 git reset for index restoration? David Turner
2014-05-22 16:46 ` Jeff King
2014-05-22 18:08 ` David Turner
2014-05-22 18:23 ` Jeff King
2014-05-22 19:26 ` David Turner
2014-05-22 16:46 ` Elijah Newren
2014-05-22 18:17 ` David Turner
2014-05-22 18:39 ` Jeff King
2014-05-22 19:07 ` David Turner
2014-05-22 19:09 ` Jeff King
2014-05-22 19:30 ` Jeff King
2014-05-22 21:34 ` Junio C Hamano
2014-05-22 21:53 ` David Turner
2014-05-22 21:58 ` Junio C Hamano
2014-05-22 22:01 ` David Turner
2014-05-22 22:12 ` Junio C Hamano
2014-05-22 22:18 ` Junio C Hamano [this message]
2014-05-22 23:33 ` Duy Nguyen
2014-05-22 23:37 ` David Turner
2014-05-22 22:29 ` Junio C Hamano
2014-05-22 23:02 ` David Turner
2014-05-22 23:14 ` Junio C Hamano
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=xmqq1tvlmp8w.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=peff@peff.net \
/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.