onefetch: Cannot load git config from non-standard paths when installed from `snap`
Duplicates
- I have searched the existing issues
Current behavior 😯
If .gitconfig
contains includeIf
option
[includeIf "gitdir:~/projects/"]
path = .gitconfig-projects
then onefetch fails on start with error:
$ onefetch
Error: Failed to load the git configuration
Caused by:
Permission denied (os error 13)
Expected behavior 🤔
No response
Steps to reproduce 🕹
- add some option “includeIf” in
~/.gitconfig
- run onefetch
Additional context/Screenshots 🔦
No response
Possible Solution 💡
No response
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 17
Commits related to this issue
- feat: display path of included configuration file that couldn't be opened. This will help with issues like these: https://github.com/o2sh/onefetch/issues/1277 — committed to Byron/gitoxide by Byron 3 months ago
- feat: display path of included configuration file that couldn't be opened. This will help with issues like these: https://github.com/o2sh/onefetch/issues/1277 — committed to Byron/gitoxide by Byron 3 months ago
For the sake of completeness, do we want to see the file stats of
onefetch
? (ls -l "$(which onefetch)"
)In my attempts to recreate this, I made a config (
path = fakepath
) and removed read and write permissions from that file. Both onefetch and git itself failed due to being unable to read the file.@ms-boom Does
git
itself raise a permission error? If not, could you give us steps to take to reproduce this error?I started small and added the path in addition to a message alluding to the failure to include the given configuration file, along with the source of the issue which would look like before.
With that, issues like these will be less opaque as well and it might be more obvious what the issue is. However, it also looks like there is nothing actionable to do here 😕.
That’s great detective work! I think the
strace
would show that it does indeed just try to access one of the included files, but since these of course aren’t included in the snap manifest, it fails to do so.Something that should definitely improve is the error message, which should at least show which file it tried to access. Besides that, I don’t think there is much that can be done as the amount of possibilities for custom includes is so wide-ranging that full access would have to be granted.