top | item 38948886

(no title)

Gee8r9 | 2 years ago

I use virtual machines for development.

discuss

order

quectophoton|2 years ago

I do something similar, depending on the project and the identity I have to use.

For local Linux projects, I have Docker images for my development environments, one per identity. So I keep my PC as minimal as I can, while the compilers, interpreters, etc, are only installed within a Docker image.

Then I go to a project's directory, run a helper command like `identity1-workspace`, and it (1) starts the Docker container for `identity1`, (2) mounts the current directory to `/workspace` within the container, and (3) also mounts some cache directories, etc.

For other hosts where I don't want to use Docker (e.g. in Raspberry Pis, or in VPS) I just have multiple users and SSH into the one I want to use.

I can do this because I just use nvim and the terminal for everything, so for me there's basically no difference between developing "natively" vs developing inside a Docker container vs developing through SSH. The only difference is whether I run the command `nvim` vs `identity1-workspace` vs `ssh identity1`[1], respectively.

All this sounds like too much work, but I'd rather use (1) Docker, or (2) `adduser` and `ssh`, because those I can do from memory and can trust to be reliable since `identity1` can't push to repos of `identity2` even by accident. In comparison, the article's `includeIf` looks like something that could easily leak an identity by accident, not to mention that I'd forget its syntax after 2 days.

[1]: Well in this case also have to then `cd somewhere ; nvim` because writing a helper for this is no big deal.

Gee8r9|2 years ago

Why downvotes? It is the most effective way to separate config. If any of those "condition" fails, you may nuke or compromise your repo!

quectophoton|2 years ago

> Why downvotes? It is the most effective way to separate config. If any of those "condition" fails, you may nuke or compromise your repo!

Maybe it was unusual enough that it didn't sound like a serious response (?), but you're completely right that the article's suggested solution can easily leak stuff by accident if you want to absolutely avoid committing with the wrong identity, thus revealing name, email, timezone, or some other metadata, in a repository where you don't want to.

If I contribute to a legal-gray-area anime fansub I don't want those people (other contributors) to know anything about my IRL identity, for example, so of course I'd reduce the possibility of info leaks due to typos or because my muscle memory betrayed me.

Like I mentioned in a sibling reply, I'd rather use a completely different OS user[1], a Docker container, or a different host.

[1]: That's literally what they are for.