r/Clojure • • Jan 05 '18

Git Deps for Clojure

https://clojure.org/news/2018/01/05/git-deps
106 Upvotes

99 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Jan 08 '18

I can delete stuff off maven if I submit a DMCA takedown etc etc. All of the possibilities you describe seem to me to be things that if a team are doing you shouldn't be consuming their code, maven, git or whatever.

2

u/yogthos Jan 08 '18

I'm not arguing against using local cache for the artifacts that your team uses here, you absolutely should be doing that. My point is regarding the stability of the overall ecosystem.

Yes, somebody could send a DMCA takedown request to a maven repo to remove artifacts, however that's a lot less common scenario than people squashing commits or rebasing. With the way things stand you're entirely relying on the owner of the repository to have a non destructive git workflow.

1

u/[deleted] Jan 08 '18

What about squashing commits or rebasing causes an issue here? Squashing commits is only something that affects new work, and rebasing is only a thing that happens to branches where change is happening. If you're using a branch as a rev then you should expect the sha it's pointing at to change. If you want to make ultra sure things can't change, refer to a sha, otherwise use a named tag which it's possible to change using git but is pretty clearly unconventional.

2

u/yogthos Jan 08 '18

You can squash any commits you like in your history, and people do that. Ultimately, git lets you do pretty much anything you like with the history of a repo.

Basically, what I see as the difference between this and maven is the following. With maven repos, there's a single set of rules that applies to all projects hosted on that repo. With the github model, each maintainer decides how they manage their particular repository. This is my concern, and I really don't think that it's an unreasonable one.

1

u/[deleted] Jan 08 '18

You can squash any commits you like in your history, and people do that. Ultimately, git lets you do pretty much anything you like with the history of a repo.

Yes I know I use that functionality all the time I just don't see what the issue is from a version control perspective. Squashing a commit doesn't actually remove it in the short term, and in the long term it generates a new sha, which means any tags pointing to it will keep pointing to the old commit.

This is my concern, and I really don't think that it's an unreasonable one.

I'm not saying it's "unreasonable", I'm saying I don't understand it. If you only ever use tags as your revs then there's already a very strong convention in git that their history won't change. If you are hyper concerned about it and only use shas then there's an algorithmic guarantee that they won't. If you're using code published by very irresponsible developers then the worst risk when using a sha is that the sha would go away. In which case they're probably doing you a favour by giving you a big red flag saying "do not use our stuff".

2

u/yogthos Jan 08 '18

You don't understand why it's not great to rely on how people manage their repos as a general dependency mechanism? Most Clojure repos don't even have tags in them.

1

u/[deleted] Jan 08 '18

No, I don't understand what squashing and rebasing "break" in particular. Most clojure repos don't have tags on them because most clojure libraries are not distributed via git. I really doubt that's a sign that the clojure community doesn't understand / will not understand git tags and their purpose. But even if you did find yourself consuming some library where they never used tags you can just use a sha.

I guess I still need you to lay out the scenario where a problem arises. Is it a scenario in which you're sourcing a library from git and using a branch name as the ref? Because unless that's your own controlled library or an experimental/dev repo I don't think anyone should expect that to work out well and I also don't think anyone should do that. (I'll note that the one example we have of deps.edn using git does not do that)

→ More replies (0)