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

Fix bug of git shallow cloning and better performance when cloning #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xuzhongping
Copy link

@xuzhongping xuzhongping commented Jan 27, 2022

Issue: #106

description

  • Fix bug of Git shallow cloning is not used when branch is set.
  • Better performance when cloning, if the parameter is branch && commit or tag && commit, determine that the commit is located in the single branch of the branch or tag, and then try whether the depth is 1.
  • Replace ASCII with UTF8 in commit_from_ls_remote to handle some character encoding errors (such as Chinese).

It should be noted that this will break the caching mechanism (for the old downloaded cache) when using branch when git downloads in the external pod in cocoapods, because I will keep the parameter ‘branch’ after preprocessing options.

If this modification is approved, I would like to go to the cocoapods gem to optimize git's caching strategy.

other

  • Looks similar to the purpose of another PR Fix bug of Git shallow cloning is not used when branch is set #117 ?
    Yes, mainly to fix the same problem, but there are some bugs in that PR, I tried to inform the author, but didn't get a follow-up, I think I can provide a more complete fix.
  • It looks like this PR does multiple bug fixes, can't they be dealt with individually?
    Yes, this PR does more than one bug fix, there are actually three, but there are some dependencies between them, and it would be very troublesome to deal with them separately, so I merged them together,and they all come with adequate testing,you can see my intent in the spec file.

@xuzhongping xuzhongping force-pushed the fix_branch_lose_shallow_clone branch from 60f5691 to fbaa675 Compare February 11, 2022 15:08
@xuzhongping xuzhongping changed the title fix bug of git shallow cloning Fix bug of git shallow cloning and better performance when cloning Feb 11, 2022
@xuzhongping xuzhongping force-pushed the fix_branch_lose_shallow_clone branch 2 times, most recently from d25112f to b897624 Compare February 11, 2022 17:12
@xuzhongping xuzhongping force-pushed the fix_branch_lose_shallow_clone branch from b897624 to ac0891e Compare February 11, 2022 17:35
@FKREISE
Copy link

FKREISE commented Nov 24, 2023

Can we please get this merged? Currently, for every pod update we have to download over 500 MB of data because our default branch during development is not master.

With this fix we only have to download 15 MB and it's over 30 times faster! cc @dnkoutso

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