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

Polish and fix git rebase --continue experience #114461

Closed
alexisfrjp opened this issue Jan 16, 2021 · 17 comments · Fixed by #151824
Closed

Polish and fix git rebase --continue experience #114461

alexisfrjp opened this issue Jan 16, 2021 · 17 comments · Fixed by #151824
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@alexisfrjp
Copy link

  • VSCode Version: 1.52.1
  • OS Version: Windows 10 home 20H2 19042.746

I have the same issue as #104502

It happens when I rebase a branch onto another one with conflicts. In VSCode, I resolve the conflicts, stage all the files and click on the tick box to commit. It runs forever like in the screen recording of the #104502's author.

While looping forever, I run git rebase --continue manually in the terminal and it tells me the file .COMMIT_EDITMSG already exits.

image

@vscodebot
Copy link

vscodebot bot commented Jan 16, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@PyroSA
Copy link

PyroSA commented Jan 26, 2021

Damn - didn't grab my screen. Ended up manually doing a git rebase continue.

In process explorer, there was (something like)

git rebase --continue
  git commit
    sh vi
      sh vi

And it hangs indefinitely.
If you kill the vi process, it gives an error and gets you back to the pre-continue state.

I'm assuming the vi process is actually waiting for input that the git extension never supplies or exposes to the user.

Possibly related - I have git pre-commit and pre-commit-msg hooks

@mattpepin
Copy link

mattpepin commented May 12, 2021

I have the same issue, here's the process explorer output with the culprit:

git rebase --continue
-- /usr/lib/git-core/git commit -n --no-gpg-sign -F .git/rebase-merge/message -e --allow-empty
---- /usr/bin/vim /home/matt/project/.git/COMMIT_EDITMSG

I'm working in a Remote SSH environement, with EDITOR=vim

If I use EDITOR="code -w", it works, but I can't change the commit message, since code is evoked remotely and just exits.

@felix-ht
Copy link

felix-ht commented Jun 4, 2021

I have the same issue on m1 mac, rebase from within vscode is broken because it either hangs or causes a "Terminal is dumb, but EDITOR unset error."

code --version
> 1.56.2
> 054a9295330880ed74ceaedda236253b4f39a335
> arm64

Logs for the hanging case. I rebased a branch on master, and resolved a conflict request from within code. If i press ✓ or do command enter the git part of code gets stuck. I can manually finish the rebase with rebase --continue. However i have been doing my rebases fully from within code for years and would like to keep doing that.

Looking for git in: /usr/bin/git
Using git 2.30.1 (Apple Git-130) from /usr/bin/git
> git rev-parse --git-dir
Open repository: /redacted
> git fetch
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/modules refs/remotes/modules
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git show --textconv :lib/data/models/serializers.g.dart
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s b0db1e32d236826b5acf110ef4890d33cbd0fbf9
> git check-ignore -v -z --stdin
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s b0db1e32d236826b5acf110ef4890d33cbd0fbf9
> git show --textconv :lib/data/models/serializers.g.dart
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/modules refs/remotes/modules
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s b0db1e32d236826b5acf110ef4890d33cbd0fbf9
> git show --textconv :lib/data/models/serializers.g.dart
> git status -z -u
> git symbolic-ref --short HEAD
> git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track) refs/heads/modules refs/remotes/modules
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git config --get commit.template
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s 8ef27c8907e2b3e346bc45b59d47b631b0aff9da
> git show --textconv :lib/data/models/serializers.g.dart
> git status -z -u
> git symbolic-ref --short HEAD
fatal: ref HEAD is not a symbolic ref
> git rev-parse HEAD
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git show -s --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%B -z ea357397bf4c9780e0dfe199a5fa76f7a3abb43b
> git check-ignore -v -z --stdin
> git status -z -u
> git symbolic-ref --short HEAD
fatal: ref HEAD is not a symbolic ref
> git rev-parse HEAD
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git show -s --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%B -z ea357397bf4c9780e0dfe199a5fa76f7a3abb43b
git.stage 1
git.stage.scmResources 1
> git add -A -- /redacted/lib/data/models/serializers.g.dart
> git status -z -u
> git symbolic-ref --short HEAD
fatal: ref HEAD is not a symbolic ref
> git rev-parse HEAD
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git show -s --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%B -z ea357397bf4c9780e0dfe199a5fa76f7a3abb43b
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s 51886970e48181eb6ccc517c06a84844cd7b104d
> git show --textconv :lib/data/models/serializers.g.dart
> git status -z -u
> git symbolic-ref --short HEAD
fatal: ref HEAD is not a symbolic ref
> git rev-parse HEAD
> git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname)
> git remote --verbose
> git show -s --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%B -z ea357397bf4c9780e0dfe199a5fa76f7a3abb43b
> git rebase --continue
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s 51886970e48181eb6ccc517c06a84844cd7b104d
> git show --textconv :lib/data/models/serializers.g.dart
> git ls-files --stage -- /redacted/lib/data/models/serializers.g.dart
> git cat-file -s 51886970e48181eb6ccc517c06a84844cd7b104d
> git show --textconv :lib/data/models/serializers.g.dart

TomTheHuman referenced this issue in TomTheHuman/messenger-app Jul 3, 2021
…/tomthehuman/messenger-app into feature-4-improve-socket"

This reverts commit a801b7a, reversing
changes made to a9314db.
@wzh-mei
Copy link

wzh-mei commented Aug 17, 2021

Version: 1.59.0
Still got this error

@eamodio eamodio added bug Issue identified by VS Code Team member as probable bug git GIT issues labels Sep 15, 2021
@eamodio eamodio added this to the Backlog milestone Sep 15, 2021
@lszomoru lszomoru assigned lszomoru and unassigned eamodio Oct 4, 2021
@Spongman
Copy link

Spongman commented Oct 4, 2021

I'm seeing the same thing. 1.60.2. commit in vscode after rebase conflict, htop shows that vscode has run git rebase --continue and that that has spawn vi in the background.

@avinersan
Copy link

avinersan commented Oct 30, 2021

Facing same issue.
Changing the git global core editor from vim to code worked.

@huwjeffries
Copy link

Same issue in VS Code version 1.6.1.2.
From the source control tab in VSCode :
... -> Branch -> Rebase branch -> Master
Resolved conflicts in the files.
Staged resolved files.
Click the tick to commit.
Commit in progress blue bar keeps going forever. Trying to commit at the Terminal gives the error:

E325: ATTENTION
Found a swap file by the name "C:/git3/sam-role-based-access-control/.git/.COMMIT_EDITMSG.swp"
          owned by: huw.jeffries   dated: Wed Nov 03 08:50:07 2021
         file name: /c/git3/sam-role-based-access-control/.git/COMMIT_EDITMSG
          modified: no
         user name: huw.jeffries   host name: MACHINE_NAME
        process ID: 1831 (STILL RUNNING)
While opening file "C:/git3/sam-role-based-access-control/.git/COMMIT_EDITMSG"
             dated: Wed Nov 03 09:01:51 2021
      NEWER than swap file!

@LisaRebecca
Copy link

Same error, for me it was fixed with git rebase --abort and quitting vscode in task manager. After the restart I was able to perform the rebase without it getting stuck.

@pri-kise
Copy link

Having the same issue on several different window 10 computers.

@MohamedAlwash
Copy link

  • VSCode Version: 1.52.1
  • OS Version: Windows 10 home 20H2 19042.746

I have the same issue as #104502

It happens when I rebase a branch onto another one with conflicts. In VSCode, I resolve the conflicts, stage all the files and click on the tick box to commit. It runs forever like in the screen recording of the #104502's author.

While looping forever, I run git rebase --continue manually in the terminal and it tells me the file .COMMIT_EDITMSG already exits.

image

I have the same problem, is there any solution?

@PyroSA
Copy link

PyroSA commented Jan 18, 2022

Changing the git global core editor from vim to code worked.

git config --global core.editor code --wait

This did work in my latest rebase. Opens the commit file in code, but it's plenty easy to close that.

@felix-ht
Copy link

works for me as well - would be nice tho if it's not even shown

@rustyx
Copy link

rustyx commented Mar 10, 2022

The VSCode Git extension should set core.editor to code --wait automatically before invoking git.
Please fix this!
For now the workaround is git config --global core.editor "code --wait". Obvious downside is that VSCode is being started even when rebasing from command line.

@DonnieFy
Copy link

Changing the git global core editor from vim to code worked.

git config --global core.editor code --wait

This did work in my latest rebase. Opens the commit file in code, but it's plenty easy to close that.

this did work for me ,thanks

pingren added a commit to pingren/vscode that referenced this issue Jun 11, 2022
@pingren pingren mentioned this issue Jun 11, 2022
@lszomoru lszomoru modified the milestones: Backlog, June 2022 Jun 13, 2022
@lszomoru lszomoru modified the milestones: June 2022, July 2022 Jun 29, 2022
@joaomoreno joaomoreno changed the title Git rebase stuck after resolving conflicts Polish and fix git rebase --continue experience Jul 9, 2022
lszomoru added a commit that referenced this issue Jul 20, 2022
suppress the editor during git rebase, fix #114461

Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jul 20, 2022
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 21, 2022
@lszomoru
Copy link
Member

This issue has been fixed with f19251a. Today's Insiders release (2022-07-21) contains the fix.
Please give it a try and let me know if you are still able to reproduce the issue. Thank you very much!

@alexr00
Copy link
Member

alexr00 commented Jul 29, 2022

@lszomoru is the fix just that the commit message editor doesn't show and that the commit input box is pre-populated with a commit message? If so, I have verified this.

@TylerLeonhardt TylerLeonhardt added the verification-steps-needed Steps to verify are needed for verification label Jul 29, 2022
@rzhao271 rzhao271 added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels Aug 1, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.