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

Re: git stash takes excessively long when many untracked files present

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 15, 2013, 18:58 UTC
Message-ID
<7vioz6rdba.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130815180736.GA4093@jtriplet-mobl1>
Josh Triplett <josh@joshtriplett.org> writes:
Show 6 quoted lines
>> I've already reverted the problematic patch to "git stash" and it
>> will not be part of the upcoming release.
>
> Thanks!
>
>> Here is a quick attempt to see if we can do better in "ls-files -k".

Having said that, I am curious if the result of applying the patch you are responding to, without reverting the "git stash" patch, is now usable in the working tree you earlier had trouble with.

> Sure, that works.  However, wouldn't it make sense to just directly let
> git ls-files output to the screen, then test its return value (after
> adding some ls-files option to set the return value)?
Not really.

We may want to add "exit early if we see even a single killed file" option to the command so that we can simplify the "are we going to abort" logic, but the error codepath that is executed after that decision is made is not performance critical, and may need more flexibility than always spewing everything that will be killed, which could be thousands of crufts. So I think using two separate invocations to "ls-files --killed" is a necessity anyway.

Previous: Josh TriplettNext: Junio C Hamano
Message 9 of 15 in “git stash takes excessively long when many untracked files present”
  1. Josh TriplettAug 10, 2013
  2. Anders DaranderAug 13, 2013
  3. Junio C HamanoAug 13, 2013
  4. Anders DaranderAug 13, 2013
  5. Junio C HamanoAug 13, 2013
  6. Junio C HamanoAug 13, 2013
  7. Junio C HamanoAug 15, 2013
  8. Josh TriplettAug 15, 2013
  9. Junio C HamanoAug 15, 2013
  10. Junio C HamanoAug 15, 2013
  11. 0/3 Optimizing "ls-files -k"Junio C Hamano, Aug 15, 2013
  12. 1/3 dir.c: use the cache_* macro to access the current indexJunio C Hamano, Aug 15, 2013
  13. 2/3 ls-files -k: a directory only can be killed if the index has a non-directoryJunio C Hamano, Aug 15, 2013
  14. 3/3 t3010: update to demonstrate "ls-files -k" optimization pitfallsJunio C Hamano, Aug 15, 2013
  15. 4/3 git stash: avoid data loss when "git stash save" kills a directoryJunio C Hamano, Aug 15, 2013

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.