Git Deps for Clojure

So Clojure’s deps tool is getting support for pulling deps from Git and using commit SHA or tag name to stick with a specific version.

{:deps
 {org.clojure/data.csv
  {:git/url "https://github.com/clojure/data.csv.git"
   :rev "e5becca"}}}

There’s an interesting discussion going on at the moment on Reddit with Rich Hickey. I found interesting @Yogthos’s concerns about potential drawbacks of this approach (Git repos are not safe/mutable). What do you think about all of this?

5 Likes

This is big. Easily using git dependencies were one of the big things missing for me in the Clojure universe. After being used to them from Ruby/Bundler and Elixir/mix, having to go through a release ceremony (possibly having to understand SNAPSHOTs) and hosting the artifacts in a repository to just use a fork of dependency with a bugfix seemed outlandish.

To quote Rich Hickey from the afore linked discussion:

I think this is a superior system with substantial benefits. […] We’ve been using this internally and it’s game-changing.

It should make it a lot easier to fork a dependency, improve it, and contribute back those improvements. I do believe the Clojure community will do a good job with this.

8 Likes

I had not thought of this use case for gitdeps… Wonderful idea !

We use this alot so I am quite keen to see gitdeps in action, just to save the song and dance.

I’m super excited about this. It sounds insane, but I’m working on something that reads deps.edn and forks github repos and then replaces your deps with the forked versions. That way I can be in total control of when something changes.

2 Likes

I like this function, but dislike the implementation.
Currently, deps info is maintained in a map config. I prefer it can be like boot: everything is code.
As I prefer explicit-over-implicit.

Could you elaborate on why code-over-data is explicit-over-implicit for you?