Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something to help with rebasing #355

Open
mightyiam opened this issue Jan 15, 2023 · 5 comments
Open

Something to help with rebasing #355

mightyiam opened this issue Jan 15, 2023 · 5 comments

Comments

@mightyiam
Copy link

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.

@gregorriegler
Copy link
Collaborator

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.

@mightyiam
Copy link
Author

$ 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?

@gregorriegler
Copy link
Collaborator

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:

return strings.HasPrefix(line, c.WipCommitMessage)

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?

@hollesse
Copy link
Member

hollesse commented Mar 9, 2023

would be fine for me.

@simonharrer
Copy link
Member

Fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants