Skip to the content
Made with Lisp

Welcome to Common-Lisp.net

Welcome to the amazing world of Common Lisp, the programmable programming language.

Ingot: Git in Common Lispa session, a step at a timeThe whole tour →

as git says it:git init --bare notes.git

CL-USER> (ql:quickload "ingot")
("ingot")
CL-USER> (defparameter *repo* (ingot:init-repository "notes.git/"))
*REPO*
CL-USER> (defparameter *me* (ingot:make-identity "A Visitor" "you@example.org"))
*ME*

as git says it:git add README.md lisp/hello.lisp; git commit -m 'First notes'

CL-USER> (ingot:make-commit! *repo* :branch "master" :author *me* :message "First notes" :actions '((:action :create :path "README.md" :content "# Notes, kept with Ingot") (:action :create :path "lisp/hello.lisp" :content "(defun hello () 'hello)")))
"aa75a5b51eca0aea9485c445bdace69bdaaa9aa5"

as git says it:git commit -am 'Hello says more'

CL-USER> (ingot:make-commit! *repo* :branch "master" :author *me* :message "Hello says more" :actions '((:action :update :path "lisp/hello.lisp" :content "(defun hello () '(hello world))")))
"9860f1e2cbfe0ac500580e0ffa266864f40308c9"

as git says it:git log --oneline

CL-USER> (defparameter *head* (ingot:head-oid *repo*))
*HEAD*
CL-USER> (mapcar #'ingot:commit-subject (ingot:log-commits *repo* *head*))
("Hello says more" "First notes")

as git says it:git ls-tree -r HEAD

CL-USER> (mapcar #'car (ingot:tree-paths *repo* (ingot:commit-tree (ingot:read-commit *repo* *head*))))
("README.md" "lisp/hello.lisp")

as git says it:git show HEAD:lisp/hello.lisp

CL-USER> (ingot:octets-to-string (ingot:blob-at *repo* *head* "lisp/hello.lisp"))
"(defun hello () '(hello world))"

as git says it:git diff HEAD~1 HEAD -- lisp/hello.lisp

CL-USER> (defparameter *parent* (first (ingot:commit-parents (ingot:read-commit *repo* *head*))))
*PARENT*
CL-USER> (ingot:unified-diff (ingot:octets-to-string (ingot:blob-at *repo* *parent* "lisp/hello.lisp")) (ingot:octets-to-string (ingot:blob-at *repo* *head* "lisp/hello.lisp")))
"--- a +++ b @@ -1 +1 @@ -(defun hello () 'hello) +(defun hello () '(hello world)) "

as git says it:git checkout -b topic master; git commit; git merge topic

CL-USER> (ingot:make-commit! *repo* :branch "topic" :start-branch "master" :author *me* :message "A to-do list" :actions '((:action :create :path "TODO.md" :content "- read the Ingot page")))
"6c8217f9ee00b74bfe52576ead9b9f38f25295d4"
CL-USER> (ingot:merge-branches! *repo* "topic" "master" :author *me*)
"6c8217f9ee00b74bfe52576ead9b9f38f25295d4" CL-USER> (ingot:branches *repo*) (("master" . "6c8217f9ee00b74bfe52576ead9b9f38f25295d4") ("topic" . "6c8217f9ee00b74bfe52576ead9b9f38f25295d4"))

as git says it:echo -n hello | git hash-object --stdin

CL-USER> (ingot:hash-object :blob (ingot:string-to-octets "hello"))
"b6fc4c620b67d95f953a5c1c1230aaab5db5a1b0"

Common-lisp.net is meant as an intro and learning site, as well as a collaboration hub, for ANSI Common Lisp implementations, libraries, and applications. This month, the site is experimenting with a new native-CL Git implementation, Ingot (source), of which you can see some REPL examples above.

Get startedHost a project

What is Common Lisp?

Common Lisp is a modern, multi-paradigm, high-performance, compiled, ANSI-standardized descendant of the long-running family of Lisp programming languages.

Common Lisp is known for being extremely flexible, having excellent support for object oriented programming, and fast prototyping capabilities. It also sports an extremely powerful macro system that allows you to tailor the language to your application, and a flexible run-time environment that allows modification and debugging of running applications (excellent for server-side development and long-running critical software). It is a multi-paradigm programming language that allows you to choose the approach and paradigm according to your application domain.

Curious?Get started!More about the language

Services

All the services

Support

Stuck with something on this site or on its GitLab? Ask in #common-lisp.net on Libera.Chat, or send the admins a request.

About this site

Run by volunteers, held by a non-profit, and paid for by its services and by gifts. The pages are a Common Lisp program, and its source takes merge requests like any project here. More on the about page.