Closed JamieEdge closed 1 week ago
We currently only check the folder at the mount point for having a .git
folder and change in ownership. We should also check all workspace folders.
Any progress on this? This is still blocking me from using git inside a dev container. It's odd that sometimes I get it to work after rebuilding a couple of times.
I'm hitting this even in the single-folder case. The appropriate .gitconfig
entry isn't getting added, although my host config is otherwise being added.
I am trying this with the most recent pre-release devcontainers extension (0.381) error.log
It looks like git rev-parse --show-toplevel
now also fails with this error message. We can fix that by parsing the error message.
@chrmarti Thanks for looking into this. For clarity, what will we need to do in our tooling (https://github.com/microsoft/vscode-remote-release/issues/10179 and https://github.com/PRQL/prql/pull/4830) to avoid this message? Many thanks
@richb-hanover The fix should take care of it when using the Dev Containers extension. The Dev Containers CLI doesn't handle this case yet.
Steps to Reproduce:
git config --global --add safe.directory '/workspaces/<folder>'
is executed in the "Dev Containers" terminal whilst starting the container for the first time.git status
within the container and observe that it exits without reporting an error.safe.directory
Git configuration option are executed in the "Dev Containers" terminal whilst starting the container.git status
within the container and observe that it reports an error ("fatal: detected dubious ownership in repository").Does this issue occur when you try this locally?: Yes Does this issue occur when you try this locally and all extensions are disabled?: Yes
This is related to https://github.com/microsoft/vscode-remote-release/issues/7628. The Git error occurs because
/workspaces
, and the contents within, are owned byroot
when using Docker Desktop for Windows, as documented in the Add a non-root user to a container section. This was fixed for the single folder use case (https://github.com/microsoft/vscode-remote-release/issues/7628#issuecomment-1406157351) but not for workspaces.This is difficult to workaround because the
safe.directory
Git configuration option requires specific directories to be specified (see I cannot add the parent directory to safe.directory in Git). As a result, it's not possible to add a value such as/workspaces/<workspace>/**
to trust all directories within the workspace directory.