I had a thought yesterday while biking into town. Git is a transcriptional database -- it writes and writes and writes, and what we are left with is its transcript. I wouldn't call it a transactional database, since it has no rollback operator. It doesn't need one. Ref updates either succeed or fail. If they fail, well, write, write again:
The Moving Ref writes; and, having commit,
Moves on: cosmic Rays nor Zero-blit
Shall untrue its blobs, its trees Unbind,
Nor all your Pushes flip a Single bit.
It is perhaps not as beautiful as Fitzgerald's translation, but the bar was set quite high. To compensate, here is what is, to my knowledge, the first translation of Khayyam into Scheme:
(define (git-update-ref refname proc count) (let* ((ref (git-rev-parse refname)) (commit (proc ref))) (cond ((zero? count) #f) ; failure ((false-if-git-error (git "update-ref" refname commit ref)) commit) (else (git-update-ref (git-rev-parse refname) (1- count))))))
The rest of the text may be found in tekuti.