pygit2 does not respect a global setting of safe.directory='*'
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 1.7k
- Fork
- 408
- Merge trung bình
- 2 ngày 57 phút
- Pull request đã merge (30 ngày)
- 7
Mô tả
We are currently working with dvc for multiple projects and the dvc exp run leads to a pygit2 exception on a azure machine learning instance. This leads to problems since folders on mounted drives in azure belong to user root whilst the working user is azureuser The exception looks like following:
_pygit2.GitError: /mnt/batch/tasks/shared/LS_root/mounts/clusters/<XXX>/.git/: repository path '/mnt/batch/tasks/shared/LS_root/mounts/clusters/<XXX>' is not owned by current user
A workaround for this problem should be setting the git safe.directory to ='*'.
But unfortunately this does not work with dvc resp. pygit2.
I narrowed the problem down and was able to reproduce it with pure pygit2.
Since it seems to be a pygit2 problem, I am opening the issue directly here.
FYI @efiop, @skshetry, @dmpetrov
My git config looks as follows:
user.email=<XXX>
user.name=<XXX>
safe.directory=*
With my normal git (git version 2.36.1) everything works great with the wildcard *. But pygit2 seems to ignore this config.
import pygit2
repo = pygit2.Repository(pygit2.discover_repository('.'))
GitError: /mnt/batch/tasks/shared/LS_root/mounts/clusters/<XXX>/.git: repository path '/mnt/batch/tasks/shared/LS_root/mounts/clusters/<XXX>/' is not owned by current user
But the config seems to be loaded:
import pygit2
config = pygit2.Config()
for x in config.get_global_config():
print(x.name + ":" + x.value)
user.email:<XXX>
user.name:<XXX>
safe.directory:*
Used Versions: pygit2 1.10.0
Any help would be really appreciated, since we can't run experiments anymore.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với việc tái hiện thuần túy bằng pygit2 sử dụng pygit2.Repository và so sánh với đầu ra Config toàn cục được hiển thị cho safe.directory=*. Điều tra việc kiểm tra quyền sở hữu repository trong pygit2 1.10.0 và xác minh hành vi so với Git 2.36.1. Được coi là hoàn tất khi một thiết lập safe.directory dạng wildcard ở cấp toàn cục cho phép mở repository được tái hiện mà không gặp lỗi quyền sở hữu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- git, python
- Lĩnh vực
- security, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100