Skip to content
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

Improve performance in big repos by adding files to stage explicitly #84

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

lordi
Copy link
Contributor

@lordi lordi commented Jan 1, 2025

In my big repo (>1 GB), it took several minutes to run "git add ." even on a one-line change.
With this fix, it works much faster and makes GitSync usable for me.

Copy link
Owner

@ViscousPot ViscousPot left a comment

Choose a reason for hiding this comment

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

I really love this change! Thank you so much for suggesting it.
I did a little research just to understand why this is faster and if it scales and it looks like this is actually the preferable implementation for even a large number of file changes.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=494323#c8

It looks like I missed reimplementing this when downgrading jgit for wider device support
https://github.com/ViscousPot/GitSync/pull/44/files#diff-248e46999edf160924fa7c9cace3d1c78ae69996d2980ef9e2b94c8f15f0c918L225

Let me know if you disagree with this being fine for more file changes, but otherwise, could you remove the gating behind the MAX_FILES_TO_STAGE_EXPLICITLY constant and I'd be happy to get this merged :)

@lordi
Copy link
Contributor Author

lordi commented Jan 2, 2025

Done, I also think it is cleaner that way

Copy link
Owner

@ViscousPot ViscousPot left a comment

Choose a reason for hiding this comment

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

Amazing!

@ViscousPot ViscousPot merged commit 3b18fbb into ViscousPot:master Jan 2, 2025
@ViscousPot ViscousPot linked an issue Jan 6, 2025 that may be closed by this pull request
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