libgit2 / libgit2/pygit2

Incorrect detection of modified/renamed files

Đang mở
#1,197 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

Test code:

import pygit2
repo = pygit2.Repository(pygit2.discover_repository(<repo_path>))

status = repo.status()
for filepath, flags in status.items():
    print(filepath, flags)

Running Result:

child.py 128
example.py 128
mvv.txt 513
mvvv.txt 4
name2.py 128
parent.py 128
x/mvv.txt 128
x/mvvv.txt 513
x/parent2.py 128
xname.py 128
zname.py 512
zname1.py 128

However, git status given me the result as:

On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        renamed:    mvvv.txt -> mvv.txt
        new file:   x/mvvv.txt

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    mvv.txt
        deleted:    x/mvvv.txt
        deleted:    zname.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .idea/
        child.py
        example.py
        name2.py
        parent.py
        x/mvv.txt
        x/parent2.py
        xname.py
        zname1.py

Which contains the renamed records.

Why this happened?
(If you want the test repo, I can zip it and send to your team mail if anyone provide me one.)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với đoạn mã Python được hiển thị và entry point repo.status(), sau đó tái hiện các flags được liệt kê đối chiếu với output git status tương ứng. Xác định liệu các bản ghi rename bị thiếu hoặc khác biệt là hành vi được mong đợi hay bug, đồng thời ghi lại kết quả mong đợi và quy trình xác minh có thể tái hiện.

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
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
Cần làm rõ
Mức phù hợp với người mới
28/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.