Closed jake-nz closed 4 years ago
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
Adding some extra stuff in an attempt to appease @vscode-triage-bot
VS Code version: Code 1.43.0 (78a4c91400152c0f27ba4d363eb56d2835f9903a, 2020-03-09T19:34:44.548Z) OS version: Darwin x64 19.3.0
FWIW, running EDITOR=code git rebase -i HEAD~5
fails as you describe, but running EDITOR='code -w' git rebase -i HEAD~5
does the right thing.
Also, I learned while experimenting with this that with EDITOR='code -w'
, you don't have to close the entire VS Code program to make Git pick up on your edits to the rebase file, it's sufficient to close the tab that the git-rebase-todo
file was in. Which means that if (as I did) you had a VS Code window open beforehand, the git-rebase-todo
file pops up for editing in the same VS Code window you were working in. And if you chose to squash some of the commits, the COMMIT_EDITMSG
file will pop up in a new tab of the same window almost as soon as you close the git-rebase-todo
tab. Handy.
/question
As you correctly -w
is required when you set core.editor
, however as @rmunn mentioned - in your second code you don't pass -w
flag to VS Code so it doesn't wait until file is closed.
@IllusionMH This was not a question; it was an attempt to get #66146 unlocked so that this information can be posted there to help those who see that issue. Now someone will have to open yet another issue to try to get #66146 unlocked. Sigh.
@rmunn Sorry! I was confused by the second VS Code example and missed part that this is answer and not related to #66146.
@bpasero could you assist with #66146 because after issue is locked there no mentions from this issue
@IllusionMH can you clarify what I should do. Do you mean that there should be a final comment on that issue that -w
is required for this to work?
Maybe remove labels from this issue (because they are not correct) add link to this issue or copy answer part there.
I unlocked that issue, feel free to update it as you see fit.
I'm seeing this exact bug: https://github.com/Microsoft/vscode/issues/66146 I know the cause and solution but the issue is locked so I can't contribute to it Is there a way I can update the issue to help @dengdairiluo and others?
The solution Set your editor to VSCode with "wait" flag
code -w
git config --global core.editor "code -w"
The cause When you run
EDITOR=vim git rebase -i HEAD~5
.git/rebase-merge/git-rebase-todo
is createdvim .git/rebase-merge/git-rebase-todo
is called.git/rebase-merge/git-rebase-todo
is deletedWhen you run
EDITOR=code git rebase -i HEAD~5
.git/rebase-merge/git-rebase-todo
is createdcode .git/rebase-merge/git-rebase-todo
is calledcode
exits.git/rebase-merge/git-rebase-todo
is deleted