polylith

tengstrand 2025-11-17T08:47:57.823239Z

Just https://clojurians.slack.com/archives/C015AL9QYH1/p1763369212631909 0.3.31.

8
itaied 2025-11-17T12:06:41.860579Z

hey all new to polylith and considering a valuation test with it a question that popped into my head about migrating our internal libs is whether we can keep git history? for example we have lib a b and c that are used by the service app. each one has its own git repo if we combine it into a single monorepo we can keep only one's history, right? what do you recommend to do about it?

msolli 2025-11-17T12:18:03.504639Z

It is a gift and an opportunity. Document whatever needs to be said about the current status of the libraries, including any design decisions and roads not taken. What's buried in those Git messages should either be re-surfaced in regular docs, or forgotten about. Note that you can keep the old repos, too, if you really need that history. It just won't be as accessible.

itaied 2025-11-17T12:31:15.428319Z

that's what i thought ok thanks, ill keep you guys updated when i encounter interesting stuff 🙂

👍 1
imre 2025-11-17T13:20:44.199309Z

you can merge git histories no problem

imre 2025-11-17T13:23:07.307829Z

git subtree add --prefix=bases/LIB-NAME  master

imre 2025-11-17T13:23:55.493109Z

this way you get to keep imported history

imre 2025-11-17T13:24:09.381049Z

I find it's useful for code archaeology

imre 2025-11-17T13:24:44.224579Z

if the remote lib gets updated before migration finishes then you can merge changes from there:

git remote add LIB-NAME 
git subtree merge --prefix=bases/LIB-NAME LIB-NAME/master

itaied 2025-11-17T15:44:19.559809Z

does git put the histories on top of each other? ill read more about it, never tried it

imre 2025-11-17T16:00:46.205289Z

basically there will be multiple initial commits in your repo

imre 2025-11-17T16:00:50.420599Z

imre 2025-11-17T16:01:46.686479Z

couldn't find the original articles where I learned about the command, but this one looks decent (it's where the above screenshot is from) https://peateasea.de/merging-git-repositories-into-subdirectories-of-another/

itaied 2025-11-18T06:54:50.716689Z

that's very cool, i didn't know git could do that thank you!

👍 1
domparry 2025-11-17T18:32:49.206289Z

I bet Polylith would make it easier for AI to understand a codebase.

2025-11-17T18:41:24.717679Z

Claude code has no problems working with a Polylith layout.

2025-11-17T23:54:07.844609Z

this is actually true for our case.

tengstrand 2025-11-18T06:11:13.033109Z

You should write a blog post about it @tlonist.sang! Nothing sells better than AI these days.

2025-11-18T06:14:15.029639Z

haha absolutely. Polylith is everything about reducing complexity. I think the key factor in ai-assisted task is giving ai the right amount of well aligned context; and polylith serves as a guardrail.

tengstrand 2025-11-18T06:15:23.380119Z

I agree, it's not just humans who have trouble juggling balls!

Patrix 2025-11-19T10:57:06.049539Z

Huh, I’ve had nothing but trouble with AI and Polylith. At least with Windsurf, no matter which model is used. Maybe Claude does better but I’m done paying for AI for now… would be interesting to read reports about how it works for others though. Mind you this was not a greenfield project, but still….

2025-11-19T14:04:51.725829Z

I see AI as a multiplier, not a magic wand. That being said it will augment the entropy of the existing codebase, and this will certainly work against whatever AI was prompted to do. Polylith itself is also not a magic spell; it serves as a guidance by forcing one to reason about the codebase.

2025-11-19T14:05:35.340669Z

Clojure is also like that. I love Clojure, but one can use it poorly to make an incomprehensible spaghetti codes. Everything is stick with two ends.