Skip to content

Uses VS Code as core.editor#2135

Merged
eamodio merged 2 commits intogitkraken:mainfrom
ShafinKhadem:VScode-core-editor
Nov 6, 2022
Merged

Uses VS Code as core.editor#2135
eamodio merged 2 commits intogitkraken:mainfrom
ShafinKhadem:VScode-core-editor

Conversation

@ShafinKhadem
Copy link
Contributor

Description

Closes #2134.

When using git commands from terminal, one may prefer to use terminal editors to edit commit messages. But when using VS Code, it's better to use VS Code to edit the commit messages. This PR ensures the usage of VS Code as core.editor whenever a terminal command is used.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@ShafinKhadem ShafinKhadem force-pushed the VScode-core-editor branch 2 times, most recently from 64c12b0 to 346c810 Compare October 23, 2022 05:32
@eamodio eamodio self-requested a review November 3, 2022 03:48
@eamodio eamodio self-assigned this Nov 3, 2022
Copy link
Member

@eamodio eamodio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I like this change, but I am concerned about changing the existing behavior -- as users might want to use their git config. We should make this an opt-in boolean setting -- gitlens.terminal.overrideGitEditor. Please add it in the terminal section of the config.

@ShafinKhadem
Copy link
Contributor Author

@eamodio I have added gitlens.terminal.overrideGitEditor config in a separate commit. However, please consider not adding this config because:

  • We aren't letting user configure sequence.editor for rebase. core.editor shouldn't be different.
  • A VS Code extension doesn't need to (or shouldn't) open another editor. If user wants to use another editor, running a terminal command is always an option.

@ShafinKhadem ShafinKhadem requested a review from eamodio November 3, 2022 18:52
@eamodio
Copy link
Member

eamodio commented Nov 3, 2022

That's a good point, let's make it on by default then, but users can still opt-out.

@ShafinKhadem
Copy link
Contributor Author

That's a good point, let's make it on by default then, but users can still opt-out.

I have kept it on by default.

@eamodio eamodio force-pushed the VScode-core-editor branch from 8cb542c to d42e025 Compare November 6, 2022 06:13
@eamodio eamodio added this to the 13.1 milestone Nov 6, 2022
@eamodio eamodio merged commit 4e999e5 into gitkraken:main Nov 6, 2022
@eamodio
Copy link
Member

eamodio commented Nov 6, 2022

Thank you so much for your contribution!

Thank you!

@ShafinKhadem ShafinKhadem deleted the VScode-core-editor branch November 7, 2022 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use VS Code as core.editor

3 participants