unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: alexis purslane via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: "71200@debbugs.gnu.org" <71200@debbugs.gnu.org>,
	"michael.albinus@gmx.de" <michael.albinus@gmx.de>
Subject: bug#71200: TRAMP: Trying to do a project-find-file or (find-directory) using the podman method causes a (wrong-type-argument stringp nil) error
Date: Mon, 27 May 2024 02:06:52 +0000	[thread overview]
Message-ID: <1Lz1FIPZ1KHsruvlYqA1e5561TOSEoJ1M1r-72pI7BuICHbq72ohFmG9Kz1ltdW-AQeedGM_3PV9ef7r9CQ3iyQzkztUeaux0PhdZdFNmcw=@pm.me> (raw)
In-Reply-To: <jFgUvi814XMYPe1N9W9uo6_xyObsZcQQyjf3QzjBews0y5VKNIMDXbpz7he9q4aJ0s-YF6c1NdkDQ0F5rNzZpKlnwYVGt0gc1uiMlxd7GV0=@pm.me>


[-- Attachment #1.1: Type: text/plain, Size: 4446 bytes --]

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 <alexispurslane@pm.me> 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.

[-- Attachment #1.2: publickey - alexispurslane@pm.me - 0x41E61568.asc --]
[-- Type: application/pgp-keys, Size: 649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

  reply	other threads:[~2024-05-27  2:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26  0:12 bug#71200: TRAMP: Trying to do a project-find-file or (find-directory) using the podman method causes a (wrong-type-argument stringp nil) error alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26  8:11 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 11:27   ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 15:29   ` Dmitry Gutov
2024-05-26 15:33     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 15:35       ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 17:07         ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 17:14           ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 17:19             ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 17:21               ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 17:26                 ` Dmitry Gutov
2024-05-26 17:46                   ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 21:43                     ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 22:44                       ` Dmitry Gutov
2024-05-26 22:48                         ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-27  2:06                           ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-27 12:44                             ` Dmitry Gutov
2024-05-27  7:52                           ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                             ` <C7v2QL8o01X80EawTfTPEJmEJE7I5chjpYb1T1rAaI5YyEkvaC6zxPutPdOgQ9D84zse2AFTGDGvKAVO_ZyDa1WzyLtv8pDNmLPz1-z0IEw=@pm.me>
     [not found]                               ` <87jzjcg92r.fsf@gmx.de>
     [not found]                                 ` <gUO8_i1pVrprtCyX4E4Paiklddt5V48SzZehFrtu3wJP5cz8o2SDuUJAOAREvxt6pY45ok96drmglpxaWbCRLKI_Zb5Yul82Yl-qaWoeFeI=@pm.me>
2024-05-29 13:57                                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 13:59                                     ` Alexis Purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 14:06                                       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 14:41                                         ` alexis purslane via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 16:35                                           ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                                             ` <-wt3_nsE6oodYaxd5JN1ab1NDts1TOBWr_rFbUljxua0xcKmNyivkT0fPfuGOjfHo3WpDoXgmHNH4E7XTizRifFSDmrwblh7AaEbHBppPRc=@pm.me>
2024-05-29 17:01                                               ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                                                 ` <efcf8a73-a46d-4c10-9df3-2ddee97583ad@gutov.dev>
2024-05-30  8:47                                                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='1Lz1FIPZ1KHsruvlYqA1e5561TOSEoJ1M1r-72pI7BuICHbq72ohFmG9Kz1ltdW-AQeedGM_3PV9ef7r9CQ3iyQzkztUeaux0PhdZdFNmcw=@pm.me' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71200@debbugs.gnu.org \
    --cc=alexispurslane@pm.me \
    --cc=dmitry@gutov.dev \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).