Just https://clojurians.slack.com/archives/C015AL9QYH1/p1763369212631909 0.3.31.
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?
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.
that's what i thought ok thanks, ill keep you guys updated when i encounter interesting stuff 🙂
you can merge git histories no problem
git subtree add --prefix=bases/LIB-NAME master
this way you get to keep imported history
I find it's useful for code archaeology
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
does git put the histories on top of each other? ill read more about it, never tried it
basically there will be multiple initial commits in your repo
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/
that's very cool, i didn't know git could do that thank you!
I bet Polylith would make it easier for AI to understand a codebase.
Claude code has no problems working with a Polylith layout.
this is actually true for our case.
You should write a blog post about it @tlonist.sang! Nothing sells better than AI these days.
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.
I agree, it's not just humans who have trouble juggling balls!
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….
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.
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.