Repository object init with literal GIT_DIR
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ả
Consider the following corner case:
ben@f1:/tmp$ git init --bare weird.git
Initialized empty Git repository in /tmp/weird.git/
ben@f1:/tmp$ cd weird.git
ben@f1:/tmp/weird.git$ git init --bare .git
Initialized empty Git repository in /tmp/weird.git/.git/
ben@f1:/tmp/weird.git$ git rev-parse --git-dir
.git
ben@f1:/tmp/weird.git$ GIT_DIR="./" git rev-parse --git-dir
./
ben@f1:/tmp/weird.git$ python3 -c 'import pygit2; print(pygit2.Repository("./"))'
pygit2.Repository('/tmp/weird.git/.git/')
ben@f1:/tmp/weird.git$ GIT_DIR=./ python3 -c 'import pygit2; print(pygit2.Repository("./"))'
pygit2.Repository('/tmp/weird.git/.git/')
It's possible to use git to work on the repo with GIT_DIR="/tmp/weird.git".
How can I use pygit2 to work on the same repo ("/tmp/weird.git") and not the other repo in "/tmp/weird.git/.git"? Essentially, I'd like to init a pygit2.Repository object with a literal GIT_DIR, without performing repository discovery.
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 tại điểm vào khởi tạo của pygit2.Repository và so sánh cách xử lý "./" của nó với hành vi GIT_DIR literal của Git. Kiểm tra hành vi mở repository hiện có của libgit2 trước khi quyết định một đường dẫn literal nên được biểu diễn như thế nào. Được coi là hoàn thành khi một Repository có thể trỏ đến /tmp/weird.git mà không phát hiện /tmp/weird.git/.git, với coverage cho trường hợp repository lồng nhau này.
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
- devtools
- Loại issue
- Tính năng
- Độ 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
- 35/100