-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(file tree): ls-tree if no grep #12421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(file tree): ls-tree if no grep #12421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great: 138ms instead of 17s.
@gerhardol I don't know if you noticed but it has the strange side effect that in the filetree, all the files are displayed with the 'add' icon instead of the file type icon (until the |
I have noticed this, too. I think I will see the cause when I am going to review this later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
45dd640
to
ec0ce1a
Compare
There is something still that is not right, but it probably works: |
This is not wrong: Icons are cached. If they have already been loaded, they can be used at once.
How is this related to this PR? |
I fixed this |
submodules are not displayed correctly after my latest change |
334ffde
to
ec097fc
Compare
Two commits added, left a branch behind and squashed and rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works well and fast for me, have not tested with removed submodule
In GetLsTreeOutput
for GitTreeParserTests.Parse_should_return_the_list
, the '\n'
need to be replaced with '\0'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is actually more efficient than just
return items.Select(ParseSingle).WhereNotNull();
(The implementation of WhereNotNull
could be turned into Where(item => item is not null)
in order to let the IL compiler optimize it. I guess there is also a cost to the statemachine for IEnumerable
and yield
.)
Do you suggest to change to |
I assume you have changed it because it costs less time / allocations. Then, no. |
7a9b273
to
392f338
Compare
392f338
to
2abd635
Compare
as well as ls-files for artificial commits. This improves the performance (especially for lfs files) to display the file tree if no grep filter is active. Some cleanup for special cases for icons in FileStatus. Optimizations for parsing file trees in GitModule. Simplification of merge commit check in CalculateDiffs(). Co-authored-by: <mstv@gmx.net>
7df22af
to
49d9da5
Compare
squashed, rebased and added #12436 (comment) |
fixes #12413
fixes #12464
Proposed changes
Improve performance (especially for lfs files) to display the file tree if no grep filter is active.
See the issue for the reduced time to run the command.
This could be moved to GitModule instead.
GitModule is a better place for checking that
Note: ls-tree cannot be used for artificial commits, but ls-files could be used
That is a separate optimization
Test methodology
view manual git log
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.