AUEB-BALab / RepoFS

Filesystem view of version control repositories
Apache License 2.0
66 stars 9 forks source link

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

Open wdkrnls opened 2 years ago

wdkrnls commented 2 years ago

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 commented 2 years ago

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)))