mob icon indicating copy to clipboard operation
mob copied to clipboard

mob start: Checkout base branch locally if it doesnt exist

Open hjwp opened this issue 6 months ago • 1 comments

we were seeing this error when calling mob next (base branch is called register99):

ERROR git --no-pager log register99..mob/register99 --pretty=format:%an --abbrev-commit
ERROR fatal: ambiguous argument 'register99..mob/register99': unknown revision or path not in the working tree.
ERROR Use '--' to separate paths from revisions, like this:

I think this happens if someone joins the session by initially checking out the wip branch instead of the base branch? ie they did git checkout mob/register99; mob start, rather than git checkout register99; mob start.

so this is very much an edge case / a user having done the "wrong" thing.

but maybe it's nice to handle this case gracefully anyhow?

(apologies i still haven't figured out the tests)

hjwp avatar Jul 04 '25 11:07 hjwp

Thank you @hjwp 😊 We would also need a test covering this scenario. Can you please add that? It should fail when your improvement is missing.

gregorriegler avatar Jul 04 '25 19:07 gregorriegler