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

squashWip does not work with git 2.19.x #331

Closed
gregorriegler opened this issue Oct 13, 2022 · 2 comments
Closed

squashWip does not work with git 2.19.x #331

gregorriegler opened this issue Oct 13, 2022 · 2 comments
Labels
bug Something isn't working hacktoberfest

Comments

@gregorriegler
Copy link
Collaborator

gregorriegler commented Oct 13, 2022

squashWip (mob done --squash-wip) does an interactive rebase which fails if you use git 2.19.x or lower

=== RUN   TestStartDoneSquashWipWithUnpushedCommit
    mob_test.go:1589: Creating testbed in temporary directory /tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001
    mob_test.go:1589:   git --bare init
    mob_test.go:1589:   git symbolic-ref HEAD refs/heads/master
    mob_test.go:1589:   git clone --origin origin file:///tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/remote .
    mob_test.go:1589:   git config --local user.name local
    mob_test.go:1589:   git config --local user.email local@example.com
    mob_test.go:1589:   git checkout -b master
    mob_test.go:1589:   git add .
    mob_test.go:1589:   git commit -m "initial import"
    mob_test.go:1589:   git push --set-upstream --all origin
    mob_test.go:1589:   git clone --origin origin file:///tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/remote .
    mob_test.go:1589:   git config --local user.name localother
    mob_test.go:1589:   git config --local user.email localother@example.com
    mob_test.go:1589:   git clone --origin origin file:///tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/remote .
    mob_test.go:1589:   git config --local user.name alice
    mob_test.go:1589:   git config --local user.email alice@example.com
    mob_test.go:1589:   git clone --origin origin file:///tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/remote .
    mob_test.go:1589:   git config --local user.name bob
    mob_test.go:1589:   git config --local user.email bob@example.com
    mob_test.go:1589:   git clone --origin origin file:///tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/remote .
    mob_test.go:1589:   git config --local user.name local-symlink
    mob_test.go:1589:   git config --local user.email local-symlink@example.com
    mob_test.go:1589: 
        ===== cd /tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/local
    mob_test.go:1589:   git add file1.txt
    mob_test.go:1589:   git commit -m not a mob session yet
    mob_test.go:1589: 
        ===== cd /tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/alice
    mob_test.go:1589:   git fetch origin --prune
    mob_test.go:1589:   git merge FETCH_HEAD --ff-only
    mob_test.go:1589: > starting new session from origin/master
    mob_test.go:1589:   git checkout -B mob-session origin/master
    mob_test.go:1589:   git push --no-verify --set-upstream origin mob-session
    mob_test.go:1589: > you are on wip branch 'mob-session' (base branch 'master')
    mob_test.go:1589:   git add --all
    mob_test.go:1589:   git commit --message mob next [ci-skip] [ci skip] [skip ci]
    mob_test.go:1589:   
    mob_test.go:1589:   lastFile:file2.txt --no-verify
    mob_test.go:1589:     file2.txt | 1 +
    mob_test.go:1589:     1 file changed, 1 insertion(+)
    mob_test.go:1589:     538970d6da1639808e7402e084ebca496dc74318
    mob_test.go:1589:   git push --no-verify origin mob-session
    mob_test.go:1589:   git checkout master
    mob_test.go:1589: 
        ===== cd /tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/local
    mob_test.go:1589:   git push
    mob_test.go:1589: 
        ===== cd /tmp/TestStartDoneSquashWipWithUnpushedCommit379541793/001/alice
    mob_test.go:1589:   git fetch origin --prune
    mob_test.go:1589:   git merge FETCH_HEAD --ff-only
    mob_test.go:1589: > joining existing session from origin/mob-session
    mob_test.go:1589: ⚠ Careful, your wip branch (mob-session) diverges from your main branch (origin/master) !
    mob_test.go:1589:   git checkout -B mob-session origin/mob-session
    mob_test.go:1589:   git branch --set-upstream-to=origin/mob-session mob-session
    mob_test.go:1589: > you are on wip branch 'mob-session' (base branch 'master')
    mob_test.go:1589: 538970d 0 seconds ago <alice>
    mob_test.go:1589:   git fetch origin --prune
    mob_test.go:1589: > rewriting history of 'mob-session': squashing wip commits while keeping manual commits.
    mob_test.go:1589: ERROR git rebase --interactive --keep-empty 4cbf4e0058d2852fa7b42aa071b8d3e22cb7ccc4
    mob_test.go:1589: ERROR error: could not open '.git/rebase-merge/git-rebase-todo': No such file or directory
    mob_test.go:1589: ERROR fatal: reference is not a tree: 4cbf4e0058d[2852](https://github.com/remotemobprogramming/mob/actions/runs/3244504219/jobs/5320767891#step:7:2853)fa7b42aa071b8d3e22cb7ccc4
    mob_test.go:1589: ERROR could not detach HEAD
    mob_test.go:1589: ERROR exit status 1
exit status 1
FAIL	github.com/remotemobprogramming/mob/v4	17.232s

since it works with git 2.20.0 I tried to find out what has changed in that version:
git 2.20.0 changelog https://github.com/git/git/blob/master/Documentation/RelNotes/2.20.0.txt

  • "git rebase -i" learned a new insn, 'break', that the user can
    insert in the to-do list. Upon hitting it, the command returns
    control back to the user.
  • "git rebase" and "git rebase -i" have been reimplemented in C.
@simonharrer
Copy link
Member

This option is probably used by people that keep their git up to date. :-) I assume that 99.9% of the mob user base doesn't use this feature, and that's why this hasn't been reported yet.

@hollesse
Copy link
Member

I think so too. This feature is rarely used and git 2.19 was release in 2018. Therefore I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants