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

Re: speed of git reset -- file

From
Joey Hess <joey@kitenet.net>
Date
Jun 2, 2011, 04:46 UTC
Message-ID
<20110602044638.GC5081@gnu.kitenet.net>
In-Reply-To
<20110602043630.GA5081@gnu.kitenet.net>
Joey Hess wrote:
Show 20 quoted lines
> Jeff King wrote:
> > Yeah, it is going to be painful on a cold cache. But I wonder whether
> > your workflow would really permit the "reset" thing to make a
> > difference. That is, are you doing "git reset -- file" from a cold
> > cache, and then doing _nothing_ else with git? Because while yes, it may
> > be annoying for the "reset" to take 30 seconds, it's warming the cache
> > so that the subsequent "diff" or "status" will take 29.1 seconds less.
> > 
> > Which isn't to say I'm not sympathetic to the performance problems of
> > large repos on a cold cache. But I'm not sure there's really a way
> > around that. You're going to want to see the stat information eventually
> > if you are doing anything meaningful with git, and once it's loaded, the
> > warm cache delay isn't too bad. Trying to avoid it seems like a losing
> > battle.
> 
> Could be true in general. While I've gotten the reset out of this
> workflow (realized I could just `git checkout HEAD file` and that would
> also clear staged changes), in this case it was actually *unlikely* that
> the cache would be unused, as I was resetting to throw unwanted changes
> away.
Typo, meant to say unlikly that the cache would be used.
-- 
see shy jo
Previous: Joey HessNext: Junio C Hamano
Message 16 of 17 in “speed of git reset -- file”
  1. Joey HessMay 31, 2011
  2. Jeff KingMay 31, 2011
  3. Junio C HamanoMay 31, 2011
  4. Jeff KingMay 31, 2011
  5. Matthieu MoyMay 31, 2011
  6. Nguyen Thai Ngoc DuyJun 1, 2011
  7. Junio C HamanoMay 31, 2011
  8. Jeff KingJun 1, 2011
  9. Joey HessJun 1, 2011
  10. Jeff KingJun 1, 2011
  11. Joey HessJun 1, 2011
  12. Jeff KingJun 1, 2011
  13. Joey HessJun 1, 2011
  14. Jeff KingJun 2, 2011
  15. Joey HessJun 2, 2011
  16. Joey HessJun 2, 2011
  17. Junio C HamanoJun 1, 2011

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.