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

Vscode must close fully (not just the open document) for the commit message to be accepted since 2.19.1.windows.1 #1913

Closed
1 task done
chriscollinsboxuk opened this issue Nov 2, 2018 · 5 comments

Comments

@chriscollinsboxuk
Copy link

chriscollinsboxuk commented Nov 2, 2018

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

64

$ git --version --build-options

git version 2.19.1.windows.1
cpu: x86_64
built from commit: 11a3092e18f2201acd53e45aaa006f1601b6c02a
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

Windows 10 64 bit

$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17134.345]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path: 
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Disabled
Enable Symlinks: Enabled
Enable Builtin Rebase: Enabled
Enable Builtin Stash: Enabled


  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Run in Git bash using ConEmu. Issue also happens in the git bash terminal when opened from the start menu.

git add .
git commit
<edit message in VSCode and save>
<close document in VSCode - git still awaits VSCode being closed fully>
  • What did you expect to occur after running these commands?

Expected commit message to be accepted when the commit message document was saved/closed.

  • What actually happened instead?

Git continued to wait for VSCode to be closed fully - previous version of Git did not require this.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Unrelated to a specific repository.

@dimitryvolkov
Copy link

For me that has been the state with older Git versions as well, not sure entirely which.

To resolve I've resorted to passing " --wait --new-window" to VSCode when configuring it as the editor, causes VSCode to open a new separate window for the commit message which allows me to close it without closing my other VSCode tabs

@michaelblyons
Copy link

Is this a duplicate of #1875 or something different?

@dscho dscho added the duplicate label Nov 6, 2018
@dscho dscho closed this as completed Nov 6, 2018
@chriscollinsboxuk
Copy link
Author

I'm not sure if this is a duplicate. This issue refers to the commit message being accepted once the document is closed, rather than closing the whole VSCode program. #1875 refers to the commit not being accepted even when the program has been closed.

@chriscollinsboxuk
Copy link
Author

I've resolved this for myself locally. It looks like something (I'm assuming the Git installer) has updated my .gitconfig file to contain:

[core]
    editor = 'C:\\Path\To\Vs\code.exe' --wait

Whereas previously, in my .gitconfig file that I have version controlled, it was set to:

[core]
    editor = code --wait

Changing it back to the previous value of code --wait has fixed the issue for me. I'm guessing that this is due to microsoft/vscode#60192 .

Either the Git installer can change to set the core.editor setting to code --wait, or once VSCode's fix is released, it should just work anyway. As I understand it, waiting for VSCode's change may be preferable due to the overhead of creating the additional process that code --wait would perform.

Thanks.

@dscho
Copy link
Member

dscho commented Nov 7, 2018

It looks like something (I'm assuming the Git installer) has updated my .gitconfig file to contain:

[core]
    editor = 'C:\\Path\To\Vs\code.exe' --wait

Yes, it looks like you chose the Visual Studio Code option in the installer that worked, but was broken by a VS Code change (which has been fixed in the meantime, as you figured out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants