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

Change how GitLens runs certain Git commands (e.g. avoid using the terminal) #3527

Open
1 of 7 tasks
eamodio opened this issue Sep 6, 2024 · 1 comment
Open
1 of 7 tasks
Assignees
Labels
debt Technical debt feature New feature or request

Comments

@eamodio
Copy link
Member

eamodio commented Sep 6, 2024

Currently GitLens falls back to terminal execution for certain git commands. It was mainly done out of convenience to avoid needing to handle many error cases, but also so that the user could easily tweak the command and execute it again themselves.

We should replace those terminal-run command with custom command like all our other Git commands, though it could still be really nice to offer to open the terminal with the command as an option/button on an error dialog/notification if the user chooses.

Can find all the commands that call this:

async runGitCommandViaTerminal(cwd: string, command: string, args: string[], options?: { execute?: boolean }) {

Which really boils down to callers of:

private async runTerminalCommand(command: string, ...args: string[]) {
await this.container.git.runGitCommandViaTerminal?.(this.uri, command, args, { execute: true });
setTimeout(() => this.fireChange(RepositoryChange.Unknown), 2500);
}

Tasks

Preview Give feedback
  1. 0 of 1
    debt feature
    sergiolms
  2. 0 of 1
    debt feature verified ✔
    sergiolms
  3. 0 of 1
    debt feature
    sergiolms
  4. 0 of 1
    debt feature
    sergiolms
  5. 0 of 1
    debt feature
    sergiolms
  6. 0 of 1
    debt feature
    sergiolms
  7. 0 of 1
    debt feature
    sergiolms

This will ultimately resolve: #3364, #2889, #2664, #2607, #2541, #2444, #2312, #2057, #1901, #1450, #732, #3364, #1767

@lishaduck
Copy link

This sounds really nice!
I assume this was prompted by the VSCode August 2024 release by the filing date, so please disregard this if so, but if not, I'd really love it if the fallback used VSCode's new Terminal shell integration API, as my shell starts up slowly and GitLens's not waiting for the prompt always messes with me :)

Thanks for GitLens! I use it everyday, the commit graph is amazing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Technical debt feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants