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

one codebase, simultaneous ensembles #360

Open
schmonz opened this issue Jan 30, 2023 · 2 comments
Open

one codebase, simultaneous ensembles #360

schmonz opened this issue Jan 30, 2023 · 2 comments

Comments

@schmonz
Copy link
Contributor

schmonz commented Jan 30, 2023

When two ensembles are naively using mob on the same repo, they’ll trample on each other’s work without meaning to. It looks like (I haven't actually tried this) if everyone sets MOB_WIP_BRANCH_QUALIFIER correctly, each ensemble session will have its own distinct working branch. This is a tradeoff, of course: in exchange for the benefit that ensemble handoffs remain effortlessly conflict-free, we pay in deferred integration effort. Under the circumstances, probably a good tradeoff for most.

Assuming I have a correct understanding of MOB_WIP_BRANCH_QUALIFIER, how do we ensure that everyone always sets it correctly every time, as effortlessly as possible? My best idea so far is for everyone’s shell .profile or equivalent:

MOB_PROG=$(command -v mob)

mob() {
    echo >&2 "nope, run mob1 or mob2"
}

mob1() {
    MOB_WIP_BRANCH_QUALIFIER="mob1" ${MOB_PROG}
}

mob2() {
    MOB_WIP_BRANCH_QUALIFIER="mob2" ${MOB_PROG}
}

Then nobody can run mob directly and risk not having sufficient configuration; instead they have to run the one whose name matches which session they’re in. This is information we're always aware of, so it seems okay to rely on.

My idea here only works with Bourne-derived Unix shells, and mob1 and mob2 are not available to be called from other programs.

Are there other ways of addressing the need that are as portable as mob is? Possibly by enhancing mob?

@hollesse
Copy link
Member

hollesse commented Jan 30, 2023

Hi Amitai, do you know the flag -b for mob start? Example mob start -b mob1 this sets the branch qualifier for that specific command.

@schmonz
Copy link
Contributor Author

schmonz commented Jan 30, 2023

Ah, that's a more concise way to express MOB_WIP_BRANCH_QUALIFIER. Still interested in how mob might (optionally of course) more natively and automatically ensure that (1) each simultaneous ensemble is on a distinct branch and (2) within each ensemble, every participant has the same branch.

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

No branches or pull requests

2 participants