Skip to content

Conversation

Leo1690
Copy link

@Leo1690 Leo1690 commented Nov 15, 2022

When lfs is used with a huge mono repository with sparse-checkout, the lfs post-commit command took a long time. Per default git ls-files, which excute during the post-commit, retrieves all file paths, irrespectevly of the sparse set. When sparse-index is used ls-files respects the --sparse parameter, which omits the irrelevant files that are not in the sparse set, resulting in a performance improvement.

When lfs is used with a huge mono repository with sparse-checkout,
the lfs post-commit command took a long time. Per default
git ls-files, which excute during the post-commit, retrieves all
file paths, irrespectevly of the sparse set. When sparse-index is
used ls-files respects the --sparse parameter, which omits the
irrelevant files that are not in the sparse set, resulting in a
performance improvement.
@Leo1690 Leo1690 requested a review from a team as a code owner November 15, 2022 11:53
Copy link
Member

@bk2204 bk2204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the patch, and welcome to Git LFS!

This seems fine to me. I noted the --sparse option lists directories for sparse directories instead of files, but since the only two places we use this function are in locking (where directories cannot be locked) and for finding .gitattributes files, which will never match, I think this is okay here and we shouldn't have any problems.

@bk2204 bk2204 merged commit 941b616 into git-lfs:main Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants