microsoft / microsoft/vscode-pull-request-github

Don't fetch every branch in contributor's remote when checking out a pull request

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

Chưa có ai nhận issue này.

feature-request
Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
796
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
46

Mô tả

Thanks for this very nice extension!! It is really nice to review code in my code editor:)

I noticed that when I clicked the blue "Checkout" button in the pull request tab, the following happens:

  1. The extension adds a remote named after the GitHub username of the pull-request author (this remote is not deleted when I "Exit review mode")
  2. This new remote is fetched (this creates remote-tracking branches for all branches in the contributor's remote)
  3. The the source branch of the pull request is checked out (this branch is not deleted when I "Exit review mode")

I don't like 2), it pollutes the output of git branch -r.
I think the extension should only fetch the branch of the pull request, i.e.

git fetch $PR_AUTHOR_REMOTE_URL $PR_BRANCH:refs/heads/pr/$AUTHOR_GITHUB_USERNAME/$PR_NUMBER

In fact, adding a remote is not even necessary as Git can fetch a branch directly into FETCH_HEAD, and we can the checkout FETCH_HEADin detached HEAD.

I understand the current behaviour might be convenient for some, but maybe it could be configurable ?

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 từ luồng Checkout của tab pull request và theo dõi cách luồng này thêm contributor remote, fetch remote đó rồi checkout source branch. So sánh hành vi này với branch-only fetch và detached checkout được đề xuất trong issue, sau đó xác định các test hiện có cho checkout ở chế độ review; hoàn thành khi các contributor branch không liên quan không còn xuất hiện trong git branch -r và việc cleanup vẫn hoạt động.

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, typescript
Lĩnh vực
developer-experience, tooling
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 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

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.