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

GIT_EDITOR set without asking and throwing error when I try amend a commit #150482

Closed
Tyriar opened this issue May 26, 2022 · 10 comments
Closed

GIT_EDITOR set without asking and throwing error when I try amend a commit #150482

Tyriar opened this issue May 26, 2022 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented May 26, 2022

Normally I would use git commit --amend and fix the error in vim, from today I see this now:

image

I see setting $GIT_EDITOR by default was intentional in #95266, I don't think we should do that; if a user is committing via the command line (not integrated git), you shouldn't touch the git commit editor unless opted into.

image

The actual error here is because the path is wrong and is missing gitEditor/:

C:\Users\Daniel\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\git\dist\gitEditor\scripts\git-editor.bat

Version: 1.68.0-insider (user setup)
Commit: 528ee1a
Date: 2022-05-26T05:16:43.433Z
Electron: 17.4.4
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.22000

@Tyriar Tyriar added the important Issue identified as high-priority label May 26, 2022
@Tyriar Tyriar added this to the May 2022 milestone May 26, 2022
@Tyriar
Copy link
Member Author

Tyriar commented May 26, 2022

Also I see `git.useEditorAsCommitInput's default value is false and I don't have it set 🤷

@bpasero
Copy link
Member

bpasero commented May 27, 2022

Why do we need to explicitly set the git editor, isn't this something a user can configure in git settings to use VSCode as git editor?

@IllusionMH
Copy link
Contributor

Related #150463

But I also agree that it looks strange to override expected config if git used in integrated terminal.
Unable to test because of an error, but wouldn't it also break interactive GitLens rebase editor?

@Tyriar
Copy link
Member Author

Tyriar commented May 27, 2022

FYI I think the fact it was on was a bug #150487, I don't have strong feelings about the setting itself.

@lszomoru
Copy link
Member

@bpasero, while users can indeed explicitly set their git editor to be VS Code, we are trying to make it easier for users to do so. The motivation/pattern here matches the one that drove the implementation of git askpass in VS Code. Happy to chat more if you want about this.

@lszomoru
Copy link
Member

Closing the issue as the GIT_EDITOR environment variable should only be set if git.useEditorAsCommitInput is enabled.

@lszomoru lszomoru added bug Issue identified by VS Code Team member as probable bug git GIT issues labels May 30, 2022
@bpasero
Copy link
Member

bpasero commented May 30, 2022

Yeah understood, I came to the same conclusion about making it easier for users.

@joyceerhl
Copy link
Contributor

git.useEditorAsCommitInput doesn't seem to be a setting anymore, are there other steps to verify this?

@joyceerhl joyceerhl added the verification-steps-needed Steps to verify are needed for verification label Jun 2, 2022
@Tyriar
Copy link
Member Author

Tyriar commented Jun 2, 2022

@joyceerhl my issue is definitely fixed because the feature was reverted, not sure if it's getting added back this release with fixed setting @lszomoru?

@lszomoru
Copy link
Member

lszomoru commented Jun 3, 2022

The feature will be added back for the next release, and the GIT_EDITOR will only be set if git.useEditorAsCommitInput is enabled. I would suggest that we mark this issue as "verified" and will reopen it in case this will still be a problem after the feature is added back.

@lszomoru lszomoru removed the verification-steps-needed Steps to verify are needed for verification label Jun 3, 2022
@Tyriar Tyriar added the verified Verification succeeded label Jun 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 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 important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants