- generic (get-object class id/name repository)#
Return an object of type
CLASSfrom the object database. The lookup will use either an oid or a name to find the object.
(odb-object common-lisp:t repository)
(odb-object common-lisp:t odb)
(remote common-lisp:t common-lisp:t)
(tag common-lisp:t common-lisp:t)
(reference common-lisp:t common-lisp:t)
(commit commit common-lisp:t)
(commit common-lisp:t common-lisp:t)
(tree common-lisp:t common-lisp:t)
(blob common-lisp:t common-lisp:t)
(object common-lisp:t common-lisp:t)
- generic (list-objects class repository &key test test-not)#
Note that although we are looking up a commit we specify as class OBJECT. The advantage of specifying OBJECT instead of COMMIT is that you do not need to know that the SHA refers to a commit. If the SHA refers to a tag a tag will be returned.
However if we do not know the SHA-1 but we do know a reference, such as a branch name or tag. We can get to the commit in a slightly more cumbersome way. (A list of references is easy to get, see the previous section.)
- generic (oid object)#
Return the identifier of
OBJECT. The identifier is typically the
SHA-1 checksum or hash code.
Note that this is an integer, and not the string you typically see reported by git.
To get the string representation use format like this:
(format nil “~40,’0X” (oid object))
or if you want lowercase hexadecimal digits:
(format nil “~(~40,’0X~)” (oid object))
- generic (full-name object)#
Returns the name of
OBJECT, as a string.
What exactly the name is depends on the type of the object.
- type git-error#
- type not-found#
- type exists#
- type ambiguous-error#
- type buffer-error#
- type user-error#
- type barerepo-error#
- type orphanedhead-error#
- type unmerged-error#
- type non-fast-forward-error#
- type invalid-spec-error#
- type merge-conflict-error#
Error conditions can be raised from libgit2 and will be converted into conditions instead of returning NIL values.
GIT> (get-object 'object 1 (open-repository #p"/home/russell/projects/ecl/")) ; Raises NOT-FOUND condition
For each of the possible libgit2 errors there is a different condition that will be raised.