Another piece of code that may be helpful: ``` (advice-add 'project-remember-project ;; If we're about to save a project :before (lambda (pr &optional something) ;; If we're using git, and git detects it as "dubious" (git ls-files = 128), (when (and (eq 'Git (cadr pr)) (let ((default-directory (caddr pr))) (= (shell-command "git ls-files") 128))) ;; Prompt the user if they want to automatically treat it as safe! (when (y-or-n-p "Dubious ownership of repository detected. Treat as safe? ") (shell-command (concat "git config --global --add safe.directory " (eshell-escape-arg (directory-file-name (file-local-name (caddr pr)))))))))) ``` It basically emulates VSCode's reaction to untrusted repositories. On Sunday, May 26th, 2024 at 10:48 PM, alexis purslane wrote: > Thanks for the detailed response! Re: ssh keys and committing, I knew that, sorry for my unclear phrasing --- lack of sharing ssh keys was making pushing fail, and lack of sharing gpg keys was making committing fail (I sign my commits with my private key). I'm working on ssh forwarding right now, although trying to sort of skip out on the whole thing by creating a tramp-method for distrobox and letting distrobox do it for me. I'll update to the new project.el soonish and let you know if the errors work better! > > On Sunday, May 26th, 2024 at 10:44 PM, Dmitry Gutov dmitry@gutov.dev wrote: > > > On 27/05/2024 00:43, alexis purslane wrote: > > > > > Follow up: > > > > > > I have these containers installed: > > > > > > 1. devcontainers/rust:latest > > > 2. devcontainers/typescript-node:latest > > > 3. devcontainers/cpp:latest > > > 4. texlive/texlive:latest > > > 5. tensorflow/tensorflow:latest-gpu > > > > > > Only one of them wor-- > > > > > > .... > > > > > > Oh. > > > > > > Git keeps "detecting dubious ownership" over each project's > > > .git/ > > > for some reason, which prevents `git ls-files` from running, > > > > That's possible. > > > > > hence the > > > problem. So this isn't really a bug per-se, it's more like a lack > > > of > > > clear enough errors. > > > > Yep. Poor error reporting came up not too long ago, and it's improved on > > master: > > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8d3e4e823f21d5a > > > > I have now bumped the version headers for xref.el and project.el. > > > > Try installing project 0.11.0 (it will be out on ELPA sometime in the > > next 24 hours), the errors should be easier to understand now. > > > > > I could also really use some help with getting the ownership and > > > gpg & ssh > > > keychain stuff (commits always fail because Magit over TRAMP can't > > > access my GPG or SSH private keys) figured out over TRAMP but I can get that help > > > elsewhere. > > > > Looking around the internet, it seems the error "detecting dubious > > ownership" comes down to file ownership - here's one of the possible > > solutions (https://askubuntu.com/a/1445820), but there are several > > different approaches being recommended in different SO and SE answers. > > > > To make a commit, you just need to have git config for user.name and > > user.email on the working machine - ssh keys are usually not required > > unless you're trying to sign commits as well. > > > > It's pushing commits to a remote (or pulling, or cloning) that usually > > becomes a problem. Over ssh, one usually solves that by enabling > > "authentication agent forwarding" - logging in with "ssh -A'. > > > > I'm not sure what is the preferred solution when using podman, but > > here's an article that describes sharing your .ssh directory with the > > container: > > https://devcodef1.com/news/1088795/ssh-agent-forwarding-in-podman-container > > (step number 3). > > > > Of course that's only safe if you're the only one with access to it. > > > > > Anyway, when git ls-files fails, maybe the stderr output it > > > produced should be > > > printed instead of just trying to parse its empty stdin and > > > crashing. > > > > Let me know how how it works for you.