Comments (17)
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?
from onefetch.
For the sake of completeness, do we want to see the file stats of onefetch
? (ls -l "$(which onefetch)"
)
from onefetch.
🤔
I wonder if this stems from git2 or gix (cc @Byron).
from onefetch.
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 onefetch
are you using?
gitoxide
will resolve such includes and I assume it could find .gitconfig-projects
and failed to read it due to a permission denied error, which is something the git
program should surface as well.
I think what could be done here is that gitoxide
can be taught to be allowed to ignore errors during includes-processing, but doing so would still be the decision of onefetch
, the governing application. It will definitely help to see what git
does here.
Thanks for your help.
from onefetch.
I use
git version 2.34.1
onefetch 2.19.0
OS: Ubuntu 22.04.4 LTS
full example of .gitconfig
:
[pull]
rebase = true
[includeIf "gitdir:~/projects/work/"]
path = .gitconfig-work
[includeIf "gitdir:~/projects/pet-projects/"]
path = .gitconfig-pet-projects
[core]
editor = vim
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.
The error is reproduced even if .gitconfig-work
and .gitconfig-pet-projects
are empty. So it looks like the problem is in the includeIf option.
from onefetch.
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
from onefetch.
That's true, thus far we can only reproduce the variant where both onefetch
and git
have trouble reading the include file, but not what you are describing unfortunately.
Seeing the result of the line proposed by @spenserblack would be very helpful.
The error is reproduced even if
.gitconfig-work
and.gitconfig-pet-projects
are empty. So it looks like the problem is in the includeIf option.
It would always try to read them which seems to be the problem. But it should be a problem for git
as well, but maybe git
has special permissions, like the SUID bit set?
Maybe let's extend the line above to:
ls -l ~/.gitconfig ~/.gitconfig-projects ~/.gitconfig-work ~/.gitconfig-pet-projects "$(which git)"
from onefetch.
ls -l ~/.gitconfig ~/.gitconfig-projects ~/.gitconfig-work ~/.gitconfig-pet-projects "$(which git)"
-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
from onefetch.
Thanks a lot! It doesn't look like git
is actually run as root, so onefetch
and git
should have the same permissions when launched. Yet, onefetch
can't read a file and probably fails right here when opening a configuration file it determined exists.
And for that I have no explanation except if onefetch
would find a file that git
doesn't actually find. But at this time there is no facility to debug this.
If you would be willing to get a local developer setup I could provide patches for gitoxide
that would help shed some light. It's not incredibly involved, but would have you clone onefetch
, clone gitoxide
, create configuration in onefetch
for it to use the local version of gitoxide
, and then apply various patches to that local clone to try onefetch
against.
Without that remote debugging, and without being able to reproduce that locally (i.e. Git works but onefetch
fails), I don't think there is more I can do.
Please let me know @ms-boom if you want to try such remote debugging with me.
from onefetch.
Related Issues (20)
- Display code metrics HOT 1
- Chore: add branch protections/rulesets to `main` branch HOT 6
- Add option to exclude files from churn HOT 4
- Errs when invoked on partial clones HOT 9
- .cls file extension not recognized HOT 6
- Make Debian packages HOT 6
- Use workspace inheritance
- build for `aarch64-pc-windows-gnullvm` is broken HOT 3
- Specify rev besides HEAD? HOT 1
- Arduino language support request HOT 15
- Switch from `actions-rs/*` actions HOT 1
- Astro support HOT 4
- [doc] Universal install anchor is broken HOT 2
- True color support not recognized on Windows Terminal HOT 6
- Make it easier to discover that data languages (JSON, YAML) and prose (Markdown) are not reported by default HOT 2
- Translate `README.md` to German 🇩🇪
- Parse .gitattributes HOT 1
- GPL-3.0-or-later licenses wrongly reported as GPL-3.0-only HOT 4
- Estimated development time. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onefetch.