This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-04
Channels
- # announcements (9)
- # babashka (5)
- # beginners (50)
- # calva (13)
- # clj-kondo (11)
- # clojure (30)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (4)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-norway (2)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojurescript (32)
- # conjure (2)
- # honeysql (1)
- # hyperfiddle (8)
- # jobs-discuss (9)
- # leiningen (2)
- # malli (3)
- # off-topic (21)
- # reitit (4)
- # shadow-cljs (10)
- # sql (3)
- # squint (17)
- # tools-deps (14)
How do people publish both a readme with the correct git deps which needs the sha and do the commit? Do you just make a release and push a README update separately after?
Ya it’s a bit of a catch-22. You want your docs that describe your release to be included in your release but they really can’t.
Ya, I guess I'll leave the sha empty for the release, and then push one more commit which just adds the sha back to the doc
Yup, that's what I do: update everything -- code, docs, build, etc -- and then cut the release, and then update the README (and CHANGELOG) to have the sha of that release. With major.minor.commits, at least you can figure out what the commits part is going to be in advance.
git rev-list --count HEAD
tells you what it is now: so you know it's going to be one more when you make that final commit to update the version number immediately prior to release.
tools.build
has a function for getting this number so you can do a bunch of stuff programmatically in build.clj
as well if you want.
But you are kinda outta luck for the :git/sha
in your docs.
I mean like: io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}
(related: gonna get around to that cljdoc/<version>
git tag sometime soon @U04V70XH6!)
Yeah, I put :git/tag "v1.2.3" :git/sha "..."
in when I make a release and then update it with the short sha immediately afterward.
See https://github.com/seancorfield/build-clj/commit/7ac1f8dee188894cee4199aaf2fbe7c6708a8680 and then https://github.com/seancorfield/build-clj/commit/7081997c3a21f50e96ee98a20f3bd97be9064a6d -- but it's kind of annoying.
While git still uses SHA1 instead of SHA256 it should be viable to build a tool that predicts the next hash. Some ideas on it here https://stackoverflow.com/questions/16951299/is-it-possible-to-precompute-a-git-commit-hash-such-that-it-can-be-placed-in-the
... or more specifically, viable to predict the short hash, which is all we care about here.
Interesting. Thank you @U90R0EPHA!