diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b362f..28b9b03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- feat: generating initial changelog ([7e210ae](https://github.com/russmatney/log/commit/7e210ae), 21 Mar 2024) + - wip: bb code gathering commits per tag ([f3be3be](https://github.com/russmatney/log/commit/f3be3be), 21 Mar 2024) ## v0.0.0 @@ -16,30 +18,34 @@ - docs: attempt to make org/github rendering work better ([77cebdc](https://github.com/russmatney/log/commit/77cebdc), 20 Mar 2024) - surprised the image name/captions don't work! + > surprised the image name/captions don't work! + - Create LICENSE ([fcf7aed](https://github.com/russmatney/log/commit/fcf7aed), 20 Mar 2024) - docs: readme todos update ([59d76e8](https://github.com/russmatney/log/commit/59d76e8), 20 Mar 2024) - feat: readme images and example.gd ([134072c](https://github.com/russmatney/log/commit/134072c), 20 Mar 2024) - also refactors to_pretty to use an opts dictionary instead of continuing - to add optional params. This should create some space for more options - and clean up the impl going forward. + > also refactors to_pretty to use an opts dictionary instead of continuing + > to add optional params. This should create some space for more options + > and clean up the impl going forward. + - feat: support Object.to_printable() via duck-typing ([1bce1eb](https://github.com/russmatney/log/commit/1bce1eb), 20 Mar 2024) - Any object can now opt-in to some other logged form by implementing an - arg-less to_printable() function. - - I wanted something cute, but `log()` already does logarithms, and pr() - or pp() felt obscure for a public function. + > Any object can now opt-in to some other logged form by implementing an + > arg-less to_printable() function. + > + > I wanted something cute, but `log()` already does logarithms, and pr() + > or pp() felt obscure for a public function. + - chore: test coverage for strings ([537e43a](https://github.com/russmatney/log/commit/537e43a), 20 Mar 2024) - fix: run ci on push ([b900292](https://github.com/russmatney/log/commit/b900292), 20 Mar 2024) - ci: initial gdunit4 github action ([ab2553c](https://github.com/russmatney/log/commit/ab2553c), 20 Mar 2024) - Straight outta https://mikeschulze.github.io/gdUnit4/faq/ci/ + > Straight outta https://mikeschulze.github.io/gdUnit4/faq/ci/ + - dep: add gd-plug-ui ([737f4d5](https://github.com/russmatney/log/commit/737f4d5), 20 Mar 2024) - feat: update gdUnit4 ([05213c0](https://github.com/russmatney/log/commit/05213c0), 20 Mar 2024) @@ -50,11 +56,13 @@ - test: quick dictionary test ([c70815a](https://github.com/russmatney/log/commit/c70815a), 9 Mar 2024) - just copy-pasting the output back into the test. aka snapshot testing? + > just copy-pasting the output back into the test. aka snapshot testing? + - chore: clean up some bits ([ed7b0c3](https://github.com/russmatney/log/commit/ed7b0c3), 9 Mar 2024) - Experimented with more readable bbcode output, only to learn that you - can just 'print' it. heh. + > Experimented with more readable bbcode output, only to learn that you + > can just 'print' it. heh. + - test: impl some basic tests ([0ca946f](https://github.com/russmatney/log/commit/0ca946f), 9 Mar 2024) - feat: first basic test running (and failing) ([64c0d23](https://github.com/russmatney/log/commit/64c0d23), 16 Feb 2024) diff --git a/bb/changelog.clj b/bb/changelog.clj index 6a317b0..47aed2e 100644 --- a/bb/changelog.clj +++ b/bb/changelog.clj @@ -3,18 +3,12 @@ [clojure.string :as string] [clojure.edn :as edn] [babashka.process :as process] - [babashka.fs :as fs] [clojure.java.shell :as clj-sh] )) (def changelog-path "CHANGELOG.md") (def repo-dir "~/russmatney/log") -(defn partition-by-newlines [lines] - (->> lines - (partition-by #{""}) - (remove (comp #{""} first)))) - (defn bash [command] (clj-sh/sh "bash" "-c" command)) @@ -64,7 +58,6 @@ "}")) (defn first-commit-hash [{:keys [dir]}] - ;; NOTE crashes/throws when no tags exist (-> ^{:out :string :dir (str dir)} (process/$ git rev-list --max-parents=0 HEAD) @@ -74,7 +67,6 @@ (-> res :out string/trim-newline)))))) (defn last-tag [{:keys [dir]}] - ;; NOTE crashes/throws when no tags exist (-> ^{:out :string :dir (str dir)} (process/$ git describe --tags --abbrev=0) @@ -84,7 +76,6 @@ (-> res :out string/trim-newline)))))) (defn all-tags [{:keys [dir]}] - ;; NOTE crashes/throws when no tags exist (-> ^{:out :string :dir (str dir)} (process/$ git describe --tags --abbrev=0) @@ -99,14 +90,8 @@ (first-commit-hash {:dir (expand "~/russmatney/log")})) (defn commits - "Retuns metadata for `n` commits at the specified `dir`. - ;; TODO support before/after - ;; TODO rename, probably just `commits` - " - [{:keys [dir n - after-tag - before-tag] - :as opts}] + "Retuns metadata for `n` commits at the specified `dir`." + [{:keys [dir n after-tag before-tag] :as opts}] (let [n (or n 500) cmd (str "git log" (str " -n " n) @@ -184,13 +169,13 @@ (defn commit->lines [commit] - ;; TODO make hyperlink [(str "- " (:commit/subject commit) " (" (commit-hash-link commit) ", " (commit-date commit) ")") (when (seq (:commit/body commit)) (str "\n" (->> (:commit/body commit) (string/split-lines) - (map #(str " " %)) - (string/join "\n"))))]) + (map #(str " > " %)) + (string/join "\n")) + "\n"))]) (defn tag-section [[tag commits]] (let [headline (str "## " (cond