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

Communicate git error instead of "unable to find git" #1507

Closed
a2k-hanlon opened this issue May 15, 2021 · 3 comments
Closed

Communicate git error instead of "unable to find git" #1507

a2k-hanlon opened this issue May 15, 2021 · 3 comments
Assignees
Labels
feature New feature or request needs-verification Request for community verification
Milestone

Comments

@a2k-hanlon
Copy link

Thanks for this extension, it is fantastically useful! I would like to share a small suggestion.

Currently, if there is an error in a user's gitconfig file and a new VSCode window with GitLens is opened, GitLens will generate a the following popup saying that git cannot be found:

image

However, this is not the real problem. The problem is a bad gitconfig. This can be confirmed by trying to run any git operation in a console - git will print something like:

fatal: bad config line 5 in file C:/Users/andrewha/.gitconfig

Instead of saying git cannot be found, the GitLens popup should communicate that there is a problem with the gitconfig. This should be doable by checking the output from a git command for a string like the above.

Alternatively, at least communicate that "git threw an error" rather than "git is not found" since that is not the case.

@a2k-hanlon a2k-hanlon added feature New feature or request triage Needs to be looked at labels May 15, 2021
@eamodio eamodio self-assigned this May 23, 2021
@eamodio eamodio added needs-verification Request for community verification pending-release Resolved but not yet released to the stable edition and removed triage Needs to be looked at labels May 23, 2021
@eamodio eamodio added this to the Soon™ milestone May 23, 2021
@eamodio
Copy link
Member

eamodio commented May 23, 2021

Can you please verify this fix in tomorrow's insiders edition?

You can install the insiders edition from here. Be sure to disable/uninstall the stable version of GitLens first.

@a2k-hanlon
Copy link
Author

Hi @eamodio, thank you for addressing this so quickly! I tested your fix on the insiders edition briefly and found the following:

  • With git removed from my user and system PATHs, git.path setting removed, error-free git config - I seem to get no error at all; no "GitLens was unable to find Git" (unexpected behaviour)
  • With git removed from my user and system PATHs, git.path setting removed, error introduced to git config - I get the "GitLens was unable to find Git" message (expected behaviour, but why not in the previous case?)
  • With git not in my PATH but with the git.path setting set appropriately, plus an error in the git config - I get the "GitLens was unable to find Git" message (unexpected behaviour)
  • With git in my PATH, with or without the git.path setting set appropriately, plus an error in the git config - I get the new "GitLens is unable to use Git. Your Git configuration seems to be invalid." (expected behaviour)

So unfortunately I'm not seeing consistent reporting of either git's presence or git config errors.

Running on Windows
VS Code version 1.56.2
GitLens Insiders 2021.5.2405
Git Version 2.31.1.windows.1

@eamodio eamodio modified the milestones: Soon™, Shipped Jun 14, 2021
@eamodio eamodio removed the pending-release Resolved but not yet released to the stable edition label Jun 14, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request needs-verification Request for community verification
Projects
None yet
Development

No branches or pull requests

2 participants