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

AttributeError: '_pygit2.Commit' object has no attribute 'size' #19

Open
wdkrnls opened this issue Jul 16, 2022 · 1 comment
Open

AttributeError: '_pygit2.Commit' object has no attribute 'size' #19

wdkrnls opened this issue Jul 16, 2022 · 1 comment

Comments

@wdkrnls
Copy link

wdkrnls commented Jul 16, 2022

Hi,

I thought your tool could be useful for probing into the guix codebase.

I am seeing the following traceback vhen I tried to look at the working tree under tag v0.1:

Traceback (most recent call last):
  File "/gnu/store/za6j8m4zdnjccfsric62gpwal3x0djjv-python-fusepy-2.0.4/lib/python3.9/site-packages/fuse.py", line 495, in _wrapper
    return func(*args, **kwargs) or 0
  File "/gnu/store/za6j8m4zdnjccfsric62gpwal3x0djjv-python-fusepy-2.0.4/lib/python3.9/site-packages/fuse.py", line 511, in getattr
    return self.fgetattr(path, buf, None)
  File "/gnu/store/za6j8m4zdnjccfsric62gpwal3x0djjv-python-fusepy-2.0.4/lib/python3.9/site-packages/fuse.py", line 759, in fgetattr
    attrs = self.operations('getattr', self._decode_optional_path(path), fh)
  File "/gnu/store/za6j8m4zdnjccfsric62gpwal3x0djjv-python-fusepy-2.0.4/lib/python3.9/site-packages/fuse.py", line 800, in __call__
    return getattr(self, op)(*args)
  File "/gnu/store/qfhxdx46w7ysgz77qpi2y3mnl73446jp-repofs-v0.2.6/lib/python3.9/site-packages/repofs/repofs.py", line 111, in getattr
    st['st_size'] = handler.file_size()
  File "/gnu/store/qfhxdx46w7ysgz77qpi2y3mnl73446jp-repofs-v0.2.6/lib/python3.9/site-packages/repofs/handlers/commit_hash.py", line 83, in file_size
    return self.oper.file_size(self.get_commit(), self.path_data['commit_path'])
  File "/gnu/store/qfhxdx46w7ysgz77qpi2y3mnl73446jp-repofs-v0.2.6/lib/python3.9/site-packages/repofs/gitoper.py", line 295, in file_size
    size = self._get_entry(commit, path).size

AttributeError: '_pygit2.Commit' object has no attribute 'size'
ls: cannot access 'nix-upstream': Bad address

P.S. - I really like the idea of this tool. Thanks for offering it to the world.

@wdkrnls
Copy link
Author

wdkrnls commented Jul 16, 2022

FYI, unlike a lot of other tools I have tried, yours seemed quite easy to package into Guix. Thanks for keeping things simple!

(define-public repofs
  (package
   (name "repofs")
   (version "v0.2.6")
   (source
    (origin
      (method git-fetch)
      (uri (git-reference
            (url "https://github.com/AUEB-BALab/RepoFS")
            (commit version)))
      (file-name (git-file-name name version))
      (sha256
       (base32
        "1cy4sn42d6q02kx29hrdlimq17phpk0rzp94n5wvlmvw6393xpwh"))))
   (build-system python-build-system)
   (inputs
    (list python-pygit2 python-fusepy))
   (home-page "https://github.com/AUEB-BALab/RepoFS")
   (synopsis
    "Virtual File Server for exploring a Git repository.")
   (description
    "RepoFS represents the Git version control system as a virtual file system where
 all commits and their contents can be traversed concurrently in a read-only manner
 using shell commands.")
   (license license:asl2.0)))

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

No branches or pull requests

1 participant