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

feat: Improve Git error output when calling Telescope git command in non-git directory #2434

Closed

Conversation

RoRep1ay
Copy link

Description

Currently, when you're calling :Telescope git_command on a non-git directory, it's outputting an error exception detailing that current directory is not a directory. I don't think this error trace is necessary, just outputting message that current directory is not a git directory is enough .

Before:
image

After:
image

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  1. On a non-git directory, run one of Telescope git command

Configuration:

  • Neovim version (nvim --version): NVIM v0.8.3
  • Operating system and version: Mac OS Ventura

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@RoRep1ay RoRep1ay force-pushed the improve-git-error-handling branch from 8cf01c5 to 903bb8a Compare March 23, 2023 08:14
Comment on lines +398 to +402
utils.notify("builtin.git", {
msg = opts.cwd .. " is not a git directory",
level = "ERROR",
})
return false
Copy link
Member

Choose a reason for hiding this comment

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

i prefer not to use vim.notify for some things that can be used for scripting. using vim.notify completly removes this ability to allow users to script around errors.

#2225 tries to resolve this and i plan to finish it.

we already merged this and had a whole discussion here on why we probably dont want to do it like that. #2181

@Conni2461
Copy link
Member

so yeah i am going to close this in favor of 2225 or another solution, i am going to figure this out today

@Conni2461 Conni2461 closed this May 24, 2023
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.

2 participants