Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

rebase discards a still-valid recorded base after the parent's history is edited, replaying the parent's old commits

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, go
Lĩnh vực
cli, developer-experience

Hướng nghiên cứu

Payload không nêu tên tệp triển khai hoặc kiểm thử nào. Hãy bắt đầu tại điểm vào gh stack rebase và tái hiện trường hợp amended-parent, sau đó theo dõi cách base đã ghi nhận được chấp nhận hoặc loại bỏ. Hoàn tất nghĩa là B chỉ replay B1 sau khi lịch sử của parent hoặc trunk bị chỉnh sửa, bao gồm cả biến thể corruption im lặng, với coverage hồi quy cho cả hai trường hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

(This issue was AI generated but I have reviewed it, understood it, and I'm accountable for its content.)

Version: gh-stack v0.1.0.

Setup: trunk main; stack A ← B (gh stack init A B); A has commit A1 modifying f.txt, B has commit B1 adding g.txt.

Repro: amend A1 on A (change f.txt, keep the message), then gh stack rebase.

Expected: B is rebased by replaying only B1 onto the amended A — B's recorded base (old A tip) is still an ancestor of B and delimits exactly B's own commits.

Actual: the recorded base is discarded (apparently because it is no longer in A's history), the boundary falls back to merge-base(A, B)below the amendment — and the old A1 is replayed onto the amended A: a bogus conflict in f.txt.

Worse variant (silent corruption): if the amendment only removes part of A1 (e.g. A1 touched f.txt + extra.txt, and the amend drops the extra.txt change), the old A1 replays cleanly: B ends up with a duplicated commit and the removed extra.txt resurrected — reported as success.

Suggested fix: accept a recorded base as the --onto boundary whenever it is an ancestor of the branch being rebased; membership in the parent's current history should not be required. This matches Graphite's restack semantics and is what makes stacks robust under history editing.

The same failure triggers when the trunk's history is edited (e.g. a commit below the stack is amended via fixup): the whole old trunk segment is replayed into the bottom stack branch.

Ngôn ngữ chính
Go
Star
1.5k
Fork
73
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
7

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.

Issue khác của github/gh-stack

Tất cả issue của github/gh-stack

Issue tương tự

Thêm issue về Go

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.