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

Optimize git fetch #518

Merged
merged 1 commit into from
Feb 8, 2020
Merged

Optimize git fetch #518

merged 1 commit into from
Feb 8, 2020

Conversation

mafredri
Copy link
Collaborator

@mafredri mafredri commented Dec 3, 2019

Only fetch information for the current branch to minimize the amount of work Pure (well, git) needs to do.

This commit also starts redirecting git stderr to /dev/null because in some cases git can start spewing errors like crazy (see #502). We also never use the stderr so there's no point in keeping it around.

Fixes #473.

Future work could include figuring out if we can somehow avoid one or both of the extra subshells (although, they're run in the async job so it will have minor impact).


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

Only fetch information for the current branch to minimize the amount of
work Pure (well, git) needs to do.

This commit also starts redirecting git stderr to `/dev/null` because in
some cases git can start spewing errors like crazy (see #502). We also
never use the stderr so there's no point in keeping it around.

Fixes #473.
@sindresorhus
Copy link
Owner

With this PR, I noticed that when I have upstream changes ( showing) and run git pull --rebase, the doesn't disappear.

@mafredri
Copy link
Collaborator Author

mafredri commented Dec 6, 2019

@sindresorhus dang, I can't seem to reproduce. Although, I'm using this in combination with the indestructible-pure branch. Could the non-disappearance be related to the worker dying?

pure.zsh Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Could the non-disappearance be related to the worker dying?

Could be, yes.

@sindresorhus sindresorhus merged commit 35ca202 into master Feb 8, 2020
@sindresorhus sindresorhus deleted the git-fetch-optimization branch February 8, 2020 20:32
kutsan pushed a commit to kutsan/pure that referenced this pull request Jun 19, 2023
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.

Very inefficient git fetch, pulls all tags and all branches
3 participants