Community
Participate
Working Groups
The discard changes operation runs for about 5 minutes on a largish repository ( 8k files, 1k directories ). I will attach a YourKit snapshot shortly.
Created attachment 190132 [details] YourKit snapshot taken during the discard changes operation I only timed part of it, as I got bored, but the root cause is clear.
Tried here with my latest fixes in Gerrit on a repo with 80k files, 40k tracked and that took about a minute (admittedly on SSD disk) so I think the issue is no longer valid. C Git is still quite a lot faster, but 1 minute is still a small time compared to what git will do. A faster way is usually to do a hard reset, but typically accomplished the same thing. There are some differences like assume-valid, which replace will ignore and overwrite anyway, i.e. replace is a little "harder" than a hard reset. I did a test here and it turn out C git reset files with the assume valid flag set, so maybe we should do the same. Reset also operates on the whole repository. C Git is also a bit faster even though it forcefully replaces all files without checking the index.