since we started using worktrees, cursive REPLs, which reference the top-level ij module, are unusable.
the top-level tools.deps ij module is kept being renamed to the name of the directory containing the worktree (which is also the branch name usually).
as a consequence, the cursive run configs, which reference that top-level become corrupt, because they point to some arbitrary module, which was named after the whatever worktree we were in, when the run config was made.
we didn't have a top-level deps.edn before; it was introduced as a recommendation by polylith, so we can have a development REPL, which can access all the clojure code and their tests, within the monorepo.
does anyone else have this problem?
it's not really a polylith related issue, because even a simple project would suffer from it, once you start checking its branches our into worktrees.
sometimes it's enough to just edit such a run config, select the renamed top-level ij module as its context and save it. but now, i can't even select any modules in the REPL editor dialog on IntelliJ IDEA 2026.2.0.1!
im thinking to just shift this all-in-one REPL into a sub-dir, but i suspect that might cause polylith related issues then, since im violating one of its conventions...
btw, i've also noticed, if i rename the top-level ij module via the "Project Structure" dialog, a .idea/.name file is created, with the given name in it.
unfortunately, this file doesn't seem to be honored by cursive and when i import a repo from existing sources, which has this .name file, cursive (or ij?) still creates a top-level module, which is named after the containing folder, not the content of .idea/.name
Yeah, this is a pain - deps doesn't have the concept of the name of a project/module, so getting it from the directory was the best thing I can think of. I wasn't aware of .idea/.name, I'll investigate that tomorrow. What I do as a workaround is to create my workspaces under a workspace name, and then within that another directory with the original project name, like: ~/.workspaces/<workspace-name>/cursive for a workspace for the cursive project. It's a little hacky but it does seem to work well.
what is a workspace? :)
i guess it refers to this intellij concept:
https://blog.jetbrains.com/idea/2024/08/workspaces-in-intellij-idea/
so how does it relate to this worktree problem?
every new worktree have to be added/imported/registered into a workspace?
what's the directory structure of your git repos then?
or that ~/.workspaces/<workspace-name>/cursive dir is a git worktree?
Sorry, I use jj which calls them workspaces - worktrees, basically.
I just put them all under ~/.workspaces, but you can put them anywhere, the important bit is the inner directory with the same same as the original project.
does jj work well together with intellij?
where does your cursive/.git/ dir live then?
we have this directory struct:
~///.git/ (`git init --bare "${REPO}/.git"`)
~//// (worktree for a branch)
~///main/ (worktree for the default branch)
~///LIN-123_some-feature/ (worktree for the `LIN-123_some-feature` branch)
so maybe we should flip it around and have the come after the branch dir, though not sure where to put the .git/ dir then:
~//???/.git/ (`git init --bare "${REPO}/.git"`)
~//// (worktree for a branch)
~//main// (worktree for the default branch)
~//LIN-123_some-feature// (worktree for the `LIN-123_some-feature` > does jj work well together with intellij? Well, it does for me, because I'm working on a plugin for it 🙂. Otherwise there are some OSS ones, not sure how good they are.
> where does your cursive/.git/ dir live then? Again, this might be different because I'm using jj, but I have my main repo at ~/dev/cursive, that has both .git and .jj dir (I'm using jj in git-colocated compat mode), and in my workspaces there is a .jj directory. I'm not sure how git manages that with worktrees though.
im more and more fed up with git. it's being patched left and right for decades now and it's still highly convoluted. fossil on the other hand seems a lot more suitable for both personal and company use. has a shitload of features out of the box, implemented in a very small, standalone binary. but it's editor / IDE integrations are neglected, so it's not so convenient to get into it and it's getting popular still :/ how have we gotten here?...
I really like jj, although it's also easy to make a mess if you're not careful. The nice thing about it is that it's integrated with git, so you can just try it out (not even your whole team has to) to see if you like it.
I investigated .idea/.name, and that does look like a good thing to add support for. Thanks, I wasn't aware of that!
that would be an immediate solution to our problems.
and even if i have the same display name for multiple projects, intellij still disambiguates it by still showing the folder and branch names too in various places.
in the meantime i will check what kind of havoc would it wreck in polylith, if i move the all-in-one dev deps.edn project from the root of the repo into a subdir and import it as a deps.edn ij module.
Sorry for the delay, fix is out now in the latest EAP, let me know how it works