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

Make fetching source tarball by git commit more robust #4680

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Oct 11, 2024

(created using eb --new-pr)

I had a crate that was supposed to fetch a git commit from https://github.com/astral-sh/pubgrub. However the specified git commit 21ceec9a5fd2e8d6f71c3ea2999078fecbd13cbe was not available for git checkout after the clone.

My understanding is, that this commit is not reachable from the default (main) branch that is fetched, possibly after same rebase.

The approach done here is to add a separate git fetch call to fetch the specified commit. That resolves the issue in my case.

We could go even further and don't use git clone at all:

mkdir repo
cd repo
git init
git fetch --depth=1 https://github.com/... sha/branch/tag [--recursive]
git checkout sha/branch/tag

A `git fetch <repo> <hash>` requires a full hash and fails with a short hash with
> could not find remote ref

Disable the depth=1 optimization and remove the fetch call for those cases.
@boegel boegel added the bug fix label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants