[7.7 Git Tools - Reset Demystified] - git reset with mode flag and pathspec
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- git
- Lĩnh vực
- documentation
Hướng nghiên cứu
Open book/07-git-tools/sections/reset.asc and read the “Reset With a Path” section around the linked syntax snippet. Rephrase the explanation so it does not suggest that --soft or --hard can be combined with a pathspec, then review the related git-reset documentation for consistency.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
General overview of your idea.
The section Reset With a Path illustrates the use of the reset command in the forms including a <pathspec>. It reads well and the example is clear but there is this snippet about the syntax that I think might be slightly confusing:
This form (since you did not specify a commit SHA-1 or branch, and you didn't specify `--soft` or `--hard`) is shorthand for `git reset --mixed HEAD file.txt`...
Using --soft or --hard in this form would actually raise an error (which makes sense) but the current wording makes it sound like they could have been valid choices. I was surprised to see that --mixed is allowed (even if it triggers a deprecation warning) but I guess that this implementation detail is the reason why the git-reset documentation does not explicitly preclude the use of a <mode> alongside a <pathspec>.
I can see why elaborations around --mixed were dropped there for the sake of clarity, so I think the snippet above would also become clearer if mentions to <mode> were dropped altogether.
What problem will this solve?
The example in this section is good as it is, but some rephrasing would avoid potential confusion around mixing <mode> with <pathspec>, and also it would improve alignment between this section and the related documentation.
Have you thought about other solutions?
I'd say it’s quite clear that the git-reset documentation encourages the use of <mode> only in the form:
git reset [<mode>] [-q] [<commit>]
without elaborating on the caveat that --mixed could be used beyond this case.
In the same spirit, I think that the snippet above could benefit from being rephrased to something along the lines of:
This form (since you did not specify a commit SHA-1 or branch) is shorthand for `git reset HEAD -- file.txt`…
and perhaps adding a note with the caveat around --mixed if it's not too convoluted.
Would this be worth a pull request? I know a related issue was closed some years ago but in this case my point is not the warning when specifying --mixed.
Do you want to help with this enhancement idea?
Yes
- Ngôn ngữ chính
- CSS
- Star
- 6.6k
- Fork
- 2.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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.
Issue khác của progit/progit2
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Semi-stale link for GitHosting Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
Tất cả issue của progit/progit2
Issue tương tự
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Link Checker Report Đang mởautomated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
VoltAgent/awesome-design-md#469 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
KhronosGroup/glTF#2648 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
sccn/sccn.github.io#108 ·