mob icon indicating copy to clipboard operation
mob copied to clipboard

mob start issue: There is something wrong with your branch name

Open BryanColle opened this issue 2 years ago • 5 comments

Hi!

I was using mob version 3.2.0 on a branch named CAT-300 and it was working great, creating a mob/CAT-300 branch successfully and letting me code.

However, I asked my teammates to install mob today (so they've got the version 4.4.0), and whenever they try to mob start on the same branch, it fails with the following logs:

 CAT-300
➜ mob start
  git fetch origin --prune
  git merge FETCH_HEAD --ff-only
> starting new session from origin/CAT-300
  git checkout -B mob/CAT-300 origin/CAT-300
ERROR git commit --allow-empty -m mob start [ci-skip] [ci skip] [skip ci]
ERROR There is something wrong with your branch name: mob/CAT-300
ERROR Please don't use forward slashes in branch names as it could prevent the creation of branches sharing a prefix later
ERROR For example, creating a "mob/CAT-300" branch will prevent creating a "mob" branch later.
ERROR Prefer "mob-CAT-300" instead.
ERROR husky - pre-commit hook exited with code 1 (error)
ERROR exit status 1

 mob/CAT-300

Notice that it succeeds in moving me to the created mob branch, but it doesn't complete successfully. We're using M1 macs, the branch mob/CAT-300 did not exist before, it was not on the remote either.

BryanColle avatar Mar 31 '23 14:03 BryanColle

It seems you use husky https://typicode.github.io/husky/ and a pre-commit hook makes the mob tool fail.

simonharrer avatar Apr 28 '23 06:04 simonharrer

We do use husky indeed! However, if it was husky's fault, why would it work with a previous version of the tool (3.2.0) and not the newer version? I tested it on the exact same commit and environment.

BryanColle avatar May 02 '23 12:05 BryanColle

@BryanColle so what changed in husky between said versions? to me it looks like the hint is in the error, which is not generated by mob.sh, nor git. I think its coming from husky

gregorriegler avatar May 21 '23 18:05 gregorriegler

@BryanColle so what changed in husky between said versions? to me it looks like the hint is in the error, which is not generated by mob.sh, nor git. I think its coming from husky

Absolutely nothing changed regarding husky’s configuration. I can believe it’s an issue/conflict with husky but it still only manifested after downloading the new version. The same day, same hour on the same commit locally, I had the old version running and it was working fine. Then my coworkers told me it was not working for them with this error. So I downloaded the new version and it was not working for me all of a sudden :/ Is there something I can try to rule out some hypothesis?

BryanColle avatar May 21 '23 19:05 BryanColle

@BryanColle Well, it says it doesn't want forward slashes in branch names. I think this message must come from a git hook. Find out where this Message is coming from and then you should be able to fix it. Start by scanning your git hooks

gregorriegler avatar May 22 '23 08:05 gregorriegler

As we got nothing new here, I pretend this to be fixed with #396 and will close this issue

hollesse avatar Apr 17 '24 08:04 hollesse