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

Help page does not show when not in git repo #168

Open
BoltonBailey opened this issue Jun 5, 2024 · 1 comment
Open

Help page does not show when not in git repo #168

BoltonBailey opened this issue Jun 5, 2024 · 1 comment

Comments

@BoltonBailey
Copy link

Describe the bug
A clear and concise description of what the bug is.

The CLI tool does not show a help page when not in a git repo, presumably because it doesn't expect to work at all outside a git repo.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Run the following command outside a git repo.

git-quick-stats --help
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git

Expected behavior
A clear and concise description of what you expected to happen.

The help page should be displayed.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

MacOS, with the version installed via brew on 2024-06-05

@tomice
Copy link
Collaborator

tomice commented Oct 1, 2024

I'm not sure if we should extend using command line when you're outside of a git repo for this utility. None of the functionality would work without being in a repo.

That said, I could add a hook to display the usage text upon error, which displays the options you're asking for. But as an alternative, there exists manpages for this that can be called via man git-quick-stats that shows all the options, and that's the current recommended way to figure out how to use the utility.

Will look into how to possibly clean up the error messages when outside a git repo, though.

arzzen added a commit that referenced this issue Oct 6, 2024
Ensure the usage function is called to display the help page if the script is not run inside a git repository.

#168
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

No branches or pull requests

2 participants