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

git: Use blobless clone instead of shallow clones #82

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Conversation

ReillyBrogan
Copy link
Contributor

Shallow clones are destructive to the history of the repo, and cannot be used in situations where we build from a git source and want to do cherry-picks from that same git source (for instance in binary repos like linux-firmware).

To fix this use blobless clones instead which gets the full history but only downloads blobs on demand. This is slightly less space efficient but works with essentially all git commands. This also lets us simplify the clone and fetch logic somewhat.

@ermo ermo added the bug Something isn't working label Mar 3, 2024
@ermo ermo added this to the 1.6.1 milestone Mar 3, 2024
@ermo ermo requested a review from silkeh March 3, 2024 22:02
Copy link
Member

@silkeh silkeh left a comment

Choose a reason for hiding this comment

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

Few minor comments and a linting failure, but otherwise LGTM!

builder/source/git.go Outdated Show resolved Hide resolved
builder/source/git.go Outdated Show resolved Hide resolved
builder/source/git.go Outdated Show resolved Hide resolved
builder/source/git.go Show resolved Hide resolved
Shallow clones are destructive to the history of the repo, and cannot be used in situations where we build from a git source and want to do cherry-picks from that same git source (for instance in binary repos like linux-firmware).

To fix this use blobless clones instead which gets the full history but only downloads blobs on demand. This is slightly less space efficient but works with essentially all git commands. This also lets us simplify the clone and fetch logic somewhat.

Signed-off-by: Reilly Brogan <[email protected]>
Copy link
Member

@silkeh silkeh left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@silkeh silkeh merged commit 8f39302 into master Mar 4, 2024
1 check passed
@EbonJaeger EbonJaeger deleted the fix-git-clone branch March 4, 2024 20:21
@silkeh silkeh mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants