Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
310 stars 59 forks source link

upload: Improve is_on_correct_base logic #105

Closed jerry-skydio closed 1 year ago

jerry-skydio commented 1 year ago

Previously this logic checked only if topic was on top of its relative branch. If it had no relative branch, it always assumed the base is correct, which may not be true.

Update the logic for non-relative reviews to check if the remote parent commit is an ancestor of the local base ref. If it is, this indicates that the review should be a rebase. If it is not, the base must have moved and the review needs to be pushed.

This will take a tiny bit more time to run for cases where the ancestor check triggers (patch ids match but parent doesn't match exactly).

Topic: uploadbase Reviewers: brian-k

jerry-skydio commented 1 year ago

Reviews in this chain: └https://github.com/Skydio/revup/pull/105 upload: Improve is_on_correct_base logic

jerry-skydio commented 1 year ago
# head base diff date summary
0 820d403b fa4e5a9a diff Apr 4 7:31 AM 2 files changed, 31 insertions(+), 11 deletions(-)
1 6e23fd5f 1a86af93 diff Apr 4 19:01 PM 0 files changed
2 b78e6d23 1a86af93 diff Apr 4 19:02 PM 1 file changed, 1 deletion(-)