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

config value 'safe.directory' was not found #16

Closed
ernstki opened this issue Aug 25, 2023 · 1 comment
Closed

config value 'safe.directory' was not found #16

ernstki opened this issue Aug 25, 2023 · 1 comment

Comments

@ernstki
Copy link

ernstki commented Aug 25, 2023

Probably everybody else has already dealt with this, but I work in an environment which lags behind the latest releases of things like Git by quite a ways.

Building git-hist 1.0.5 with cargo and Rust 1.71 is successful, but I receive this error message upon actually running git hist FILENAME:

$ git-hist FILENAME
Error: Faild to open a git repository for the current directory

Caused by:
    config value 'safe.directory' was not found; class=Config (7); code=NotFound (-3)

I believe this relates to a recently-discovered security vulnerability in Git, and a resulting workaround in git2-rs. I'll update the issue description with references as I do more research.

As a temporary workaround, you can define GIT_CEILING_DIRECTORIES as described here. Edit: git2-rs really wants what it says it wants, which is to see safe.directory for the current directory in ~/.gitconfig. Here's how to add that:

$ git config --add --global safe.directory $PWD

Possibly related

@ernstki
Copy link
Author

ernstki commented Aug 25, 2023

Note this is an upstream Git, libgit, and git2-rs problem, not git-hists's problem, therefore closing.

I just wanted to document it here for posterity, in case this error message from git-hist was someone else's first encounter with it.

@ernstki ernstki closed this as completed Aug 25, 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

No branches or pull requests

1 participant