Open EdgyMeshx opened 3 hours ago
Hm, this seems challenging. We might need to copy the file into the build context? Or clone in the user's directory then move it into the cache? It's possible we'll need the config for future fetches though.
The issue with copying it is it can be in multiple pieces depending on current location. Currently we only go one repo deep so a single fetch would suffice, but if we ever did nest repos you are right, additional fetches could be needed.
If there is some way for the cwd to be the context uv runs against, so any file look ups start in the "correct" location and walk the tree upwards, I believe it would solve (at least my version) of the problem.
Have just tested and gitconfig does not honor relative paths, so the store file should be a full path if it was to be copied.
To clarify, this isn't just a git-credentials issue, this would impact custom ssh keys in the same way
having this instead of credential in /code/work/.gitconfig
is also lost by uv.
[core]
sshCommand = "ssh -i ~/.ssh/id_work"
have updated issue title
This is a follow on from #8413, I have a custom
.gitconfig
in a child directory that is picked up if I am editing a repo inside that child directory (effectively allowing me to commit etc under a user other than my default self.)This works fine using git normally, but if I configure it to point to a custom
.git-credentials
file, it appears to go ignored byuv
. I think this is somewhat expected behaviour as my custom.gitconfig
is only picked up if you are in a subdirectory of the location of that custom config.I am assuming that uv is running git from its own location not the
cwd
and this is causing custom configuration to be ignored. Is there any way to prevent this from happening, or any way this could be addressed (have uv pick up the cwd where it was executed and have that be the context its children commands like git run in?) as a part of uv.Example configs ~/.gitconfig
~/code/work/.gitconfig
If I move the git credentials to home, uv picks them up just fine.