FileNotFoundError: [Errno 2] No such file or directory: '/.../.git/refs/tags'
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Hi 👋
I've tried running the tool in a Git repo that has no tags:
$ uvx projspec scan
Failed to resolve spec FileNotFoundError(2, 'No such file or directory')
Traceback (most recent call last):
File "/home/max/.cache/uv/archive-v0/S13eoWc95_VgPtDr/lib/python3.12/site-packages/projspec/proj/base.py", line 176, in resolve
inst.parse()
File "/home/max/.cache/uv/archive-v0/S13eoWc95_VgPtDr/lib/python3.12/site-packages/projspec/proj/git.py", line 36, in parse
for _ in self.proj.fs.ls(f"{self.proj.url}/.git/refs/tags", detail=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/max/.cache/uv/archive-v0/S13eoWc95_VgPtDr/lib/python3.12/site-packages/fsspec/implementations/local.py", line 61, in ls
path_info = self.info(path)
^^^^^^^^^^^^^^^
File "/home/max/.cache/uv/archive-v0/S13eoWc95_VgPtDr/lib/python3.12/site-packages/fsspec/implementations/local.py", line 101, in info
out = os.stat(path, follow_symlinks=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/<REDACTED>/.git/refs/tags'
projspec version: 0.4.1
All the other info comes out nicely 👍
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in projspec/proj/git.py at the parse method and inspect the .git/refs/tags listing shown in the traceback. Reproduce with uvx projspec scan in a Git repository with no tags, then make the scan complete without raising FileNotFoundError and verify that the other project information still appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100