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

Unable to install from git branch. revspec not found #2772

Closed
krishnasism opened this issue Apr 2, 2024 · 3 comments · Fixed by #2795
Closed

Unable to install from git branch. revspec not found #2772

krishnasism opened this issue Apr 2, 2024 · 3 comments · Fixed by #2795
Assignees
Labels
bug Something isn't working

Comments

@krishnasism
Copy link

Hi,
I am trying to install a custom branch from git directly, but it fails with an error revspec not found

% uv pip install --no-cache-dir  git+https://github.com/weareprestatech/pdfminer.six.git@20240222#egg=pdfminer-six
Updating https://github.com/weareprestatech/pdfminer.six.git (20240222)                                                                                                                                              error: Failed to build source distribution
  Caused by: Git operation failed
  Caused by: revspec '20240222' not found; class=Reference (4); code=NotFound (-3)

This works fine without uv (i.e., only pip) or with uv if I don't mention the branch

Both of the following work:

% pip install --no-cache-dir  git+https://github.com/weareprestatech/pdfminer.six.git@20240222#egg=pdfminer-six 
% uv pip install --no-cache-dir  git+https://github.com/weareprestatech/pdfminer.six.git#egg=pdfminer-six 

System: MacOS M2

@charliermarsh charliermarsh added the bug Something isn't working label Apr 2, 2024
@charliermarsh
Copy link
Member

The problem is that we treat 20240222 like a "short commit", whereas here it's actually a branch.

@charliermarsh
Copy link
Member

You can fix this by using the full Git SHA instead of 20240222, but we should support it anyway.

@charliermarsh charliermarsh self-assigned this Apr 2, 2024
@krishnasism
Copy link
Author

krishnasism commented Apr 2, 2024

Thanks :) I'll try this in the meanwhile

charliermarsh added a commit that referenced this issue Apr 4, 2024
## Summary

If we're given a Git reference like `20240222`, we currently treat it as
a short commit hash. However... it _could_ be a branch or a tag. This PR
improves the Git reference logic to ensure that ambiguous references
like `20240222` are handled appropriately, by attempting to extract it
as a branch, then a tag, then a short commit hash.

Closes #2772.
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 a pull request may close this issue.

2 participants