git.fiddlerwoaroof.com
name mode size
.gitignore 100644 0 kb
.projectile 100644
LICENSE 100644 1 kb
README.org 100644 4 kb
branch.lisp 100644 2 kb
cl-git.asd 100644 1 kb
commit.lisp 100644 1 kb
extract.lisp 100644 4 kb
git.lisp 100644 5 kb
graph.lisp 100644 3 kb
model.lisp 100644 3 kb
package.lisp 100644 0 kb
porcelain.lisp 100644 3 kb
protocol.lisp 100644 1 kb
repository.lisp 100644 1 kb
tree.lisp 100644 2 kb
undelta.lisp 100644 1 kb
util.lisp 100644 2 kb
README.org
* CL-GIT: the pure lisp interface to Git objects ** Introduction Git libraries for Common Lisp common in a couple forms. Some attempt to wrap the libgit2 git library (e.g. https://github.com/russell/cl-git). Others wrap the git binary in a subprocess (e.g. http://shinmera.github.io/legit/). Such libraries work well in cases where you control the environment but not all lisp programs run in such circumstances. This library, on the contrary, attempts to implement parsers for git's file formats as well as a thin "porcelain" interface for manipulating git objects. ** Installation #+BEGIN_SRC sh % git clone https://github.com/fiddlerwoaroof/fwoar.lisputils.git "$HOME/quicklisp/local-projects/fwoar-lisputils" % git clone https://github.com/fiddlerwoaroof/cl-git.git "$HOME/quicklisp/local-projects/cl-git" % sbcl --load "$HOME/quicklisp/setup.lisp" CL-USER> (ql:quickload :cl-git) #+END_SRC ** Example usage *** Get the commit id of the master branch for a specific repository: #+BEGIN_SRC lisp :exports both (git:in-repository "~/quicklisp/local-projects/cl-git") (git:git (branch "master")) ;; the argument to branch defaults to "master" #+END_SRC #+RESULTS: : 821ddf96c37e65ccc9a0f4bfe2b8ac6e255a2cb6 *** Show the commit message #+BEGIN_SRC lisp :exports both (git:in-repository "~/quicklisp/local-projects/cl-git") (git:git (branch "master") ;; the argument to branch defaults to "master" (show)) #+END_SRC #+RESULTS: : tree a7cbe10af08aed7b24b633649db6dc4cec011a3f : parent 077088c8c359489ed1f6d8e441ec76438076542e : author Ed Langley <el-github@elangley.org> 1562896534 -0700 : committer Ed Langley <el-github@elangley.org> 1562896534 -0700 : : Add README, polish porcelain *** Show the messages of the commit's parent #+BEGIN_SRC lisp :exports both (git:in-repository "~/quicklisp/local-projects/cl-git") (git:git (branch "master") ;; the argument to branch defaults to "master" (commit-parents) (map 'git:show) (<<= 'identity)) #+END_SRC #+RESULTS: : tree e70a61be268cbaa6a7825295fbe54beaa3c59c71 : parent e1f7c67a8774d65bb941eeb2b41f71f333fa1a94 : author Ed Langley <el-github@elangley.org> 1562893971 -0700 : committer Ed Langley <el-github@elangley.org> 1562893971 -0700 : : (bump) *** Show the files in a commit #+BEGIN_SRC lisp :exports both (git:in-repository "~/quicklisp/local-projects/cl-git") (list* #("name" "mode" "hash") (git:git (branch "master") (contents) (tree) (contents) (filter-tree ".*.lisp"))) #+END_SRC #+RESULTS: | name | mode | hash | | branch.lisp | 100644 | e06b66967fa4fa005ccf00dcbc7d839b22259593 | | extract.lisp | 100644 | e69272bd90575f4dc99801a06287531bf2d09017 | | git.lisp | 100644 | 6e4821d169fc505dd2b598d4bf4bdfc512ea6ebd | | graph.lisp | 100644 | a4220a28d4800e38b8b8f85db0d97afc8b889293 | | model.lisp | 100644 | dbfe85d03296435b4a33ef3dc26456080e3f0263 | | package.lisp | 100644 | d2818bb88b8ec5235a8ae91309f31ba58d941d42 | | porcelain.lisp | 100644 | c1b83741c4dc3104f1686c20b143300db0a0e258 | | undelta.lisp | 100644 | ae0a070133d1a14d6e940a0f790f40b37e885b22 | | util.lisp | 100644 | 87c2b9b2dfaa1fbf66b3fe88d3a925593886b159 | ** Not Implemented Yet: - Delta refs