To keep the cursor sane, compute the new commit hash for the rewritten commit and set follow to that.
Notes:
We change gs_log_graph_refresh to a GsTextCommand which seems unrelated at first sight. This is just done for to have a proper type of the first argument of resolve_commit_to_follow_after_rebase. (Classically, resolve_commit_to_follow_after_rebase would be in a "mixin".)
The side-effects follow_head and follow_new_commit check if self.view is actually a log_graph as all these commands are actually generic enough to be called from elsewhere.
To keep the cursor sane, compute the new commit hash for the rewritten commit and set
follow
to that.Notes:
We change
gs_log_graph_refresh
to aGsTextCommand
which seems unrelated at first sight. This is just done for to have a proper type of the first argument ofresolve_commit_to_follow_after_rebase
. (Classically,resolve_commit_to_follow_after_rebase
would be in a "mixin".)The side-effects
follow_head
andfollow_new_commit
check ifself.view
is actually alog_graph
as all these commands are actually generic enough to be called from elsewhere.