-
Notifications
You must be signed in to change notification settings - Fork 287
Cannot load git config from non-standard paths when installed from snap
#1277
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
Comments
🤔 I wonder if this stems from git2 or gix (cc @Byron). |
Thanks for the heads-up! What does Git do in the same situation? I presume it just works? Or does it print anything? Also, which platform are you on and which version of
I think what could be done here is that Thanks for your help. |
In my attempts to recreate this, I made a config ( @ms-boom Does |
I use
full example of
This is correct for Git. Everything is fine with file permissions too. I use this configuration at work. If i remove options with "includeIf" onefetch works fine. |
Sorry, I mean a way to recreate the file permissions so we can test this out. Could you try running this? ls -l ~/.gitconfig ~/.gitconfig-projects ~/.gitconfig-work ~/.gitconfig-pet-projects |
That's true, thus far we can only reproduce the variant where both Seeing the result of the line proposed by @spenserblack would be very helpful.
It would always try to read them which seems to be the problem. But it should be a problem for Maybe let's extend the line above to:
|
-rw-rw-r-- 1 ms-boom ms-boom 254 Feb 22 20:37 /home/ms-boom/.gitconfig
-rw-rw-r-- 1 ms-boom ms-boom 243 Jan 29 21:27 /home/ms-boom/.gitconfig-pet-projects
-rw-rw-r-- 1 ms-boom ms-boom 220 Jan 10 15:32 /home/ms-boom/.gitconfig-work
-rwxr-xr-x 1 root root 3702168 Jul 7 2023 /usr/bin/git |
Thanks a lot! It doesn't look like And for that I have no explanation except if If you would be willing to get a local developer setup I could provide patches for Without that remote debugging, and without being able to reproduce that locally (i.e. Git works but Please let me know @ms-boom if you want to try such remote debugging with me. |
For the sake of completeness, do we want to see the file stats of |
Sorry, I forgot that I installed the package via snap, and it seems that this is the issue.
|
That's definitely bringing us closer, thanks so much for trying and validating the 'build-from-source' route. Since we have come such a long way, I feel a little more information might be able to solve the riddle. Would you be able to check which files are opened, and how, via If the My hypothesis is that the effective user of the snap-version truly isn't entitled to read that file, whereas the effective user that is executing it would be (as seen when using the locally built version of |
This is actually very helpful. I know very little about snaps (rarely install them, have never built one myself), but IIRC they have limited permissions compared to "traditional" executables, and can raise permission denied errors when even trying to read from directories outside of @Byron, do you think gix might be looking in a directory that the snap wouldn't have access to in this scenario? And could that be affected by the presence of the |
Shortly after submitting that comment I figured I should actually read our snapcraft config 😆 Lines 26 to 35 in c83a959
I also don't use the Sorry, @Byron, please ignore my last question about gix 🙂 |
That's great detective work! I think the 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. |
Yeah, 100% agree. Additionally, maybe the error message could include possible reasons that it failed to access the file:
|
…ened. This will help with issues like these: o2sh/onefetch#1277
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 :/. |
…ened. This will help with issues like these: o2sh/onefetch#1277
@ms-boom I don't think we can do much to resolve this issue besides making the error message more clear and directing users to alternative installation methods if this happens. What do you think? Would a warning on the snap installation instructions be sufficient? If so, we'd be happy to get a PR! |
snap
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Duplicates
Current behavior 😯
If
.gitconfig
containsincludeIf
optionthen onefetch fails on start with error:
Expected behavior 🤔
No response
Steps to reproduce 🕹
~/.gitconfig
Additional context/Screenshots 🔦
No response
Possible Solution 💡
No response
The text was updated successfully, but these errors were encountered: