Liking cljdoc? Tell your friends :D

Clojure API

Geschichte deliberately exposes small namespaces rather than one generated API.

NamespaceResponsibility
geschichte.reporepository lifecycle, worktree/index, commits, refs, merge and history
geschichte.fsdirectory-aware byte filesystem over the current worktree
geschichte.workspacestructurally shared Datahike workspaces and publication
geschichte.queryportable read views over Datahike database values
geschichte.git.localnative .git discovery and object/ref import
geschichte.git.httpinjectable smart-HTTP clone/fetch/push/pull
geschichte.git.transportJVM HTTP/SSH transport selection
geschichte.yggdrasiloptional Yggdrasil adapter

Filesystem API

(require '[geschichte.fs :as fs])

(fs/mkdir! conn "/src")
(fs/write! conn "/src/demo.clj" (.getBytes "(ns demo)\n" "UTF-8"))
(fs/stat conn "/src/demo.clj")
(fs/list-dir conn "/src")
(fs/rename! conn "/src/demo.clj" "/src/core.clj")
(fs/delete! conn "/src/core.clj")

Directory entities are worktree state. Git/Geschichte commits contain files; empty directories are not committed.

Datalog

The query namespace returns stable maps for common UI/application needs, while ordinary Datahike queries can combine repository facts with application data:

(require '[datahike.api :as d]
         '[geschichte.query :as gq])

(gq/repository @conn)
(gq/refs @conn)
(gq/commits @conn)
(gq/worktree @conn)

(d/q '[:find ?path ?size
       :where
       [?entry :geschichte.work/path ?path]
       [?entry :geschichte.work/size ?size]]
     @conn)

Payload bytes are intentionally store refs, not indexed inline values. Query metadata first and load bytes through repo/read, repo/read-entry, or Konserve blob access only when required.

Async portability

JVM calls return direct values. Effectful CLJS calls return partial-CPS awaitable values where Datahike/Konserve are asynchronous; pure query, diff, merge-planning, Git object, and protocol operations remain synchronous.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close