@@ -34,7 +34,7 @@ def __init__(self, newbase: str, rebase_merges: bool, onto: bool, oldbase: str,
3434 if self .onto :
3535 if not self .oldbase :
3636 print (
37- "git-sim error: Please specify <oldbase> as the parent of the commit to rebase"
37+ "git-sim error: When using --onto, please specify <oldbase> as the parent of the commit to rebase"
3838 )
3939 sys .exit (1 )
4040 elif not self .is_on_mainline (self .oldbase , "HEAD" ):
@@ -127,6 +127,10 @@ def construct(self):
127127
128128 reached_base = False
129129 merge_base = self .repo .git .merge_base (self .newbase , self .repo .head .commit .hexsha )
130+ base_branch_commits = list (self .repo .iter_commits (f"{ merge_base } ...HEAD" ))
131+ for bc in base_branch_commits :
132+ if merge_base in [p .hexsha for p in bc .parents ]:
133+ reached_base = True
130134 if merge_base in self .drawnCommits or (self .onto and self .to_rebase [- 1 ].hexsha in self .drawnCommits ):
131135 reached_base = True
132136
@@ -185,6 +189,7 @@ def construct(self):
185189 self .reset_head_branch (rebased_sha_map [default_commits [0 ][0 ].hexsha ])
186190 else :
187191 self .reset_head_branch (parent )
192+
188193 self .color_by (offset = 2 * len (self .to_rebase ))
189194 self .show_command_as_title ()
190195 self .fadeout ()
@@ -222,7 +227,7 @@ def setup_and_draw_parent(
222227 if self .rebase_merges :
223228 circle .move_to (
224229 self .drawnCommits [orig ].get_center (),
225- ).shift (m .UP * 4 + (m .LEFT if settings .reverse else m .RIGHT ) * len (default_commits [0 ]) * 2.5 + (m .LEFT * side_offset if settings .reverse else m .RIGHT * side_offset ) * 5 )
230+ ).shift (m .UP * 4 + (m .LEFT if settings .reverse else m .RIGHT ) * len (default_commits [0 ]) * 2.5 + (m .LEFT if settings .reverse else m .RIGHT ) * ( 5 + side_offset ) )
226231 else :
227232 circle .next_to (
228233 self .drawnCommits [child ],
@@ -254,7 +259,7 @@ def setup_and_draw_parent(
254259 else :
255260 continue
256261 else :
257- end = tuple (self .drawnCommits [p .hexsha ].get_center () + m .UP * 4 + (m .LEFT if settings .reverse else m .RIGHT ) * len (default_commits [0 ]) * 2.5 + (m .LEFT * side_offset if settings .reverse else m .RIGHT * side_offset ) * 5 )
262+ end = tuple (self .drawnCommits [p .hexsha ].get_center () + m .UP * 4 + (m .LEFT if settings .reverse else m .RIGHT ) * len (default_commits [0 ]) * 2.5 + (m .LEFT if settings .reverse else m .RIGHT ) * ( 5 + side_offset ) )
258263 arrow_start_ends .add ((start , end ))
259264 except KeyError :
260265 pass
0 commit comments