remotemobprogramming / mob

Tool for smooth git handover.
https://mob.sh
MIT License
1.66k stars 149 forks source link

Errors when branch name contains a dash #399

Closed el-dom closed 11 months ago

el-dom commented 1 year ago

mob.sh version: v4.4.5 git version: 2.42.0

This issue might be related to #365 but it's still happening for me with the current version 4.4.5

The branch name is ABT-970_use_topics_instead_of_pg_queue

start works and creates the branch mob/ABT-970_use_topics_instead_of_pg_queue

showNext fails on this mob branch because currentBaseBranch seems to be just ABT instead of ABT-970_use_topics_instead_of_pg_queue

 mob next
  git add --all
  git commit --message mob next [ci-skip] [ci skip] [skip ci]

  lastFile:src/app.js --no-verify
    src/app.js | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)
    c9d143fa64fe769508080df621f66f9103685331
  git push --no-verify origin mob/ABT-970_use_topics_instead_of_pg_queue
ERROR git --no-pager log ABT..mob/ABT-970_use_topics_instead_of_pg_queue --pretty=format:%an --abbrev-commit
ERROR fatal: ambiguous argument 'ABT..mob/ABT-970_use_topics_instead_of_pg_queue': unknown revision or path not in the working tree.
ERROR Use '--' to separate paths from revisions, like this:
ERROR 'git <command> [<revision>...] -- [<file>...]'
ERROR exit status 128

done fails in a similar fashion since the mob branch cannot be merged into the non-existing ABT branch

mob done
  git fetch origin --prune
  git push --no-verify origin mob/ABT-970_use_topics_instead_of_pg_queue
ERROR git checkout ABT
ERROR error: pathspec 'ABT' did not match any file(s) known to git
ERROR exit status 1
gregorriegler commented 12 months ago

Hi @el-dom. I am not able to reproduce this on my computer. Can you help me figure out this issue? Please tell me what git version you are using by running git version. Please also show me your git config by running git config -l When you show me your git config, make sure to spoof any secret information. Also, would you be up for a Pair Programming, trying this on your computer?

el-dom commented 12 months ago
git -v
git version 2.42.0
user.name=Dominic Michel
user.email=redacted
core.editor=vim
core.commentchar=#
pull.rebase=true
init.defaultbranch=main
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=redacted
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.mob/ABT-970_use_topics_instead_of_pg_queue.remote=origin
branch.mob/ABT-970_use_topics_instead_of_pg_queue.merge=refs/heads/mob/ABT-970_use_topics_instead_of_pg_queue

Generally i'm up to pairing but the particular branch which caused this issue was unfortunately deleted so i cannot offer a reproduction case anymore.

gregorriegler commented 12 months ago

Can you reproduce it if you create a branch with a similar name in some private git repository? Because if you can, we then know that its not specific to the server, and it would make sense to automate this scenario.

el-dom commented 11 months ago

Closing this for now since i cannot reproduce it.

kwstannard commented 10 months ago

I had a similar error and it turned out to be caused by the base branch being deleted. I think the error message slicing the branch at the - causes extra confusion.