git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: naive question

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 19, 2005, 17:41 UTC
Message-ID
<Pine.LNX.4.58.0504191036560.19286@ppc970.osdl.org>
In-Reply-To
<20050419171534.GH12757@pasky.ji.cz>
On Tue, 19 Apr 2005, Petr Baudis wrote:
Show 6 quoted lines
> 
> I'd actually prefer, if:
> 
> (i) checkout-cache simply wouldn't touch files whose stat matches with
> what is in the cache; it updates the cache with the stat informations
> of touched files

Run "update-cache --refresh" _before_ doing the "checkout-cache", and that is exactly what will happen.

But yes, if you want to make checkout-cache update the stat info (Ingo wanted to do that too), it should be possible. The end result is a combination of "update-cache" and "checkout-cache", though: you'll effectively need to both (just in one pass).

With the current setup, you have to do
	update-cache --refresh
	checkout-cache -f -a
	update-cache --refresh
which is admittedly fairly inefficient.

The real expense right now of a merge is that we always forget all the stat information when we do a merge (since it does a read-tree). I have a cunning way to fix that, though, which is to make "read-tree -m" read in the old index state like it used to, and then at the end just throw it away except for the stat information.

		Linus
Previous: Petr BaudisNext: Linus Torvalds
Message 5 of 6 in “naive question”
  1. Paul MackerrasApr 19, 2005
  2. David WoodhouseApr 19, 2005
  3. Ingo MolnarApr 19, 2005
  4. Petr BaudisApr 19, 2005
  5. Linus TorvaldsApr 19, 2005
  6. Linus TorvaldsApr 19, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.