mob
mob copied to clipboard
Something to help with rebasing
I often enough rebase mob branches.
I rebase the base branch and then the mob branch. But before rebasing the mob branch, I squash all the mob next commits.
I'd like more automation in this workflow. The least of it could be a mob squash command that squashes all the mob next commits.
But, perhaps a mob rebase <branch> command is of more value.
When you say rebase, what branch do you rebase on what other branch, and for what reason? Do you rebase the mob on the base branch?
We had the command mob squash-wip to squash all the mob next (in other words wip commits) before and removed it in Version 2.6.0 https://github.com/remotemobprogramming/mob/releases/tag/v2.6.0) in favor of mob done --squash-wip.
So Version 2.5.0 still has mob squash-wip.
Not impossible to revive it.
Need to better understand your motivation and use cases in detail.
$ git switch master
$ git switch -c feature
$ mob start --create
# Make some progress. Realize that a prior refactor is in order.
$ mob next
$ git switch master
$ git switch -c refactor
$ mob start --create
# Finish refactor
$ mob done
$ git commit
$ git switch master
$ git merge refactor
$ git switch mob/feature
$ git rebase -i feature # Squash all the `mob next` commits into one
$ git switch feature
$ git rebase master # This is a fast-forward
$ git push
$ git switch mob/feature
$ git rebase feature
# Solve conflicts only once
$ git push -f
I wrote this without testing. Looks correct.
Sounds like mob squash-wip is what I was referring to by mob squash. That would replace the $ git rebase -i feature command above and also allow a more intuitive order of some of the above commands. So it would be a step forward for me and some of the mobs I participate in. I would love to have it.
How are mob next commits identified? Something in the commit message or perhaps a reliable mechanism?
How are mob next commits identified? Something in the commit message or perhaps a reliable mechanism?
It identifies next commits by comparing the commit message here:
https://github.com/remotemobprogramming/mob/blob/4ac1d3e059ab603bf2464e51934da516e493bb8c/configuration/configuration.go#L65
c.WipCommitMessage is whatever you put in your config. Default is mob next [ci-skip] [ci skip] [skip ci]
@simonharrer @hollesse What do you think about reviving the mob squash-wip command?
would be fine for me.
Fine for me.