Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] Add read_cache_from() and discard_cache()
Date: Sat, 01 Jul 2006 11:51:44 -0700	[thread overview]
Message-ID: <7v64ihdupr.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0607011657460.29667@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Sat, 1 Jul 2006 17:06:14 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> True, I missed that one. But it is just a call to 
> cache_tree_free(active_cache_tree); in discard_cache(), right?

On the codepath to write out the new index file, calling
cache_free_tree(&active_cache_tree) before write_cache() is all
that should be needed.  When "active_cache_tree == NULL",
write_cache() would write out an index file without the cached
tree information.

Currently not many things take advantage of cached tree
information to optimize its operation.  But I'd like to change
that.  For example, tree merges by read-tree should be able to
take advantage of the fact that a cached tree read from the
index and three trees being read all match for a subdirectory
and do the merge of the directory without descending into it.

>>  - index_timestamp is left as the old value in this patch when
>>    you switch cache using read_cache_from() directly.  I have a
>>    suspicion you may be bitten by "Racy Git" problem, especially
>>    because the operations are supposed to happen quickly thanks
>>    to the effort of you two ;-) increasing the risks that the
>>    file timestamp of the working tree file and the cached entry
>>    match.
>
> Yes. Again, just one line to discard_cache(), right?
>
> 	index_file_timestamp = 0;

This one I am not sure.  Read the comment in ce_match_stat() and
see the problematic sequence of events that this variable tries
to help resolve applies to your use.

  reply	other threads:[~2006-07-01 18:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-30  0:27 [PATCH 4/4] save another call to git-update-index Alex Riesen
2006-06-30  0:37 ` Johannes Schindelin
2006-06-30  7:22   ` Alex Riesen
2006-06-30  9:56     ` Johannes Schindelin
2006-06-30 11:33       ` Alex Riesen
2006-06-30 14:43   ` Johannes Schindelin
2006-06-30 14:43   ` [PATCH 1/3] Add read_cache_from() and discard_cache() Johannes Schindelin
2006-06-30 16:44     ` Junio C Hamano
2006-07-01 15:06       ` Johannes Schindelin
2006-07-01 18:51         ` Junio C Hamano [this message]
2006-07-02  8:51           ` Johannes Schindelin
2006-07-03 21:04             ` Junio C Hamano
2006-07-04 14:18               ` Johannes Schindelin
2006-07-04 17:41                 ` Junio C Hamano
2006-06-30 14:43   ` [PATCH 2/3] Make refresh_cache_entry() public Johannes Schindelin
2006-06-30 14:44   ` [PATCH 3/3] merge-recursive: avoid the pipe to update-index Johannes Schindelin

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=7v64ihdupr.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox