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

Allow to customize the .gitconfig? #168

Open
gaeljw opened this issue Jan 17, 2025 · 0 comments
Open

Allow to customize the .gitconfig? #168

gaeljw opened this issue Jan 17, 2025 · 0 comments

Comments

@gaeljw
Copy link

gaeljw commented Jan 17, 2025

Hello folks,

Would it make sense to allow to customize the .gitconfig used by Sourcebot through Sourcebot config? Or we say it's not Sourcebot responsibility and the user has to define the .gitconfig however needed depending on Sourcebot is installed (like mounting a volume to /root/.gitconfig if using the container/K8S approach).

I'm asking the question because I faced the need to configure the .gitconfig for a corner case today due to mounting the repos through a volume that didn't have the right file ownerships.

I was facing the following error:

[backend] | 2025-01-16T13:18:28.357Z error: [main] fatal: detected dubious ownership in repository at '/data/repos/gitlab.mycompany.net/mygroup/myrepo.git'
[backend] | To add an exception for this directory, call:
[backend] |
[backend] | 	git config --global --add safe.directory /data/repos/gitlab.mycompany.net/mygroup/myrepo.git
[backend] |
[backend] | Error: fatal: detected dubious ownership in repository at '/data/repos/gitlab.mycompany.net/mygroup/myrepo.git'
[backend] | To add an exception for this directory, call:
[backend] |
[backend] | 	git config --global --add safe.directory /data/repos/gitlab.mycompany.net/mygroup/myrepo.git
[backend] |
[backend] |     at Object.action (file:///app/node_modules/simple-git/dist/esm/index.js:4462:25)
[backend] |     at PluginStore.exec (file:///app/node_modules/simple-git/dist/esm/index.js:4501:25)
[backend] |     at file:///app/node_modules/simple-git/dist/esm/index.js:1369:43
[backend] |     at new Promise (<anonymous>)
[backend] |     at GitExecutorChain.handleTaskData (file:///app/node_modules/simple-git/dist/esm/index.js:1367:16)
[backend] |     at GitExecutorChain.<anonymous> (file:///app/node_modules/simple-git/dist/esm/index.js:1351:44)
[backend] |     at Generator.next (<anonymous>)
[backend] |     at fulfilled (file:///app/node_modules/simple-git/dist/esm/index.js:45:24)
[backend] |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

And I temporarily worked around it by adding a .gitconfig with following content in Sourcebot pod:

[safe]
	directory = *

Obviously, this is quite a corner case but I wanted to track this here if anyone face the same issue and/or if there's other cases of having to customize the .gitconfig in the future 🤷

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