python / python/devguide

Documenting pushdefault config option

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

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

topic-git type-feature
Ngôn ngữ chính
Python
Star
2.1k
Fork
1k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
12

Mô tả

There seem to be 3 variations of the git push command:

  1. Use git push origin branchname and always specify the remote and the branch
  2. Use git push -u origin branchname on the first push to set origin as the default and then just use git push
  3. Set the pushdefault to origin in .git/config and just use git push

The first method is the one suggested in the devguide
(e.g. in the submitting section); the second is also documented in the pushing changes section; the third is apparently somewhat recent and not yet documented.

The pushdefault is configured by adding to .git/config:

[remote]
    pushdefault = origin

Where origin refers to the user's fork of cpython. AFAICT almost all the pushes should go to origin.

Each method has pros and cons:

First method:

  • pros: explicit is better than implicit
  • cons: longer to type, harder to remember, could get the arg names/order wrong

Second method:

  • pros: still explicit but shorter to type for the following pushes
  • cons: same as above but only applies to the first push on each branch

Third method:

  • pros: easier to remember, shorter to type, works like hg push
  • cons: less explicit

The question is: which one should we adopt as the recommended method?

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

Xem lại các phần submitting và pushing changes được liên kết trong devguide, cùng với ví dụ về pushdefault trong .git/config. So sánh ba workflow đã được ghi lại và xác định phương pháp nào guide nên đề xuất, sau đó cập nhật tài liệu liên quan để làm rõ lựa chọn đó và cách thiết lập.

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
Lĩnh vực
documentation
Loại issue
Tài liệu
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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

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.