Skip to content

emacsorphanage/libegit2

Repository files navigation

libgit2 bindings for Emacs

Travis build status Appveyor build status

This is an experimental module for libgit2 bindings to Emacs, intended to boost the performance of magit.

Other work in this direction:

This module is written in C, and aims to be a thin wrapper around libgit2. That means that all functions in the libgit2 reference should translate more-or-less directly to Emacs, in the following sense:

  • Function names are the same, except with underscores replaced by hyphens. The prefix is changed from git- to libgit-.
  • Predicate functions are given a -p suffix, and words like "is" are removed, e.g. git_repository_is_bare becomes libgit-repository-bare-p.
  • Output parameters become return values.
  • Error codes become error signals (type giterr).
  • Return types map to their natural Emacs counterparts, or opaque user pointers when not applicable (e.g. for git-??? structures). Exceptions: git-oid and git-buf types are converted to Emacs strings.
  • Boolean parameters or pointers towards the end of argument lists whose natural default value is false or NULL will be made optional.

Quality-of-life convenience functionality is better implemented in Emacs Lisp than in C.

Building

There is a loader file written in Emacs Lisp that will build the module for you, but the git submodule steps need to be run manually.

git submodule init
git submodule update
mkdir build
cd build
cmake ..
make

If you're on OSX and using Macports, you may need to set CMAKE_PREFIX_PATH to avoid linking against the wrong libiconv. For example,

cmake -DCMAKE_PREFIX_PATH=/opt/local ..

Testing

Ensure that you have Cask installed.

cask install
cd build
make test

To see more output for debugging new tests you can specify more verbose output.

make test ARGS=-V

Using

Ensure that libgit.el is somewhere in your load path. Then

(require 'libgit)

If the dynamic module was not already built, you should be asked to do it manually.

If you use Borg, then use the following .gitmodules entry.

[submodule "libgit"]
    path = lib/libgit
    url = git@github.com:magit/libegit2.git
    build-step = make

Contributing

Adding a function

  1. Find the section that the function belongs to (i.e. git_SECTION_xyz).
  2. Create, if necessary, src/egit-SECTION.h and src/egit-SECTION.c.
  3. In src/egit-SECTION.h, declare the function with EGIT_DEFUN. See existing headers for examples.
  4. In src/egit-SECTION.c, document the function with EGIT_DOC. See existing files for examples.
  5. In src/egit-SECTION.c, implement the function. See existing files for examples.
    1. Always check argument types in the beginning. Use EGIT_ASSERT for this. These macros may return.
    2. Then, extract the data needed from emacs_value. This may involve allocating buffers for strings.
    3. Call the libgit2 backend function.
    4. Free any memory you might need to free that was allocated in step 2.
    5. Check the error code if applicable with EGIT_CHECK_ERROR. This macro may return.
    6. Create return value and return.
  6. In src/egit.c, create a DEFUN call in egit_init. You may need to include a new header.

Adding a type

Sometimes a struct of type git_??? may need to be returned to Emacs as an opaque user pointer. To do this, we use a wrapper structure with a type information tag.

Some objects expose data that belong to other objects. In many cases, libgit2 keeps reference-counts on these internally, but that's not always true. In particular, git_repository structs are not reference-counted (although the data-owning sub-objects like git_odb are). Neither are lightweight public structs like git_index_entry, git_diff_XYZ, etc. In these cases, the parent types must be reference-counted on our side, and the child types must keep a reference to the parent alive.

  1. In src/egit.h, add an entry to the egit_type enum for the new type.
  2. In src/egit.h add a new EGIT_ASSERT macro for the new type.
  3. In src/egit.c add a new entry to the egit_finalize switch statement to free the structure. If the type is reference-counted, also add an entry to the decref switch statement.
  4. In src/egit.c add a new entry to the egit_typeof switch statement.
  5. In src/egit.c add a new type predicate by calling the TYPECHECKER macro.
  6. In src/egit.c create a DEFUN call in egit_init for the type predicate.
  7. In src/interface.h add two new symbols, libgit-TYPE-p and TYPE.
  8. In src/interface.c initialize those symbols in the em_init function.

Returning opaque pointers to Emacs

To create a new user pointer, call egit_wrap with arguments:

  1. The emacs_env*
  2. The type tag
  3. The pointer to wrap
  4. The parent wrapper, if applicable (note: this is an egit_object*, not a git_XYZ*)

To return an existing user pointer (usually by grabbing the parent field of an egit_object*), just increase the reference count and use the EM_USER_PTR macro. Do not do this for types that are not reference-counted!

Function list

This is a complete list of functions in libgit2. It therefore serves more or less as an upper bound on the amount of work needed.

Legend:

  • ✔️ Function is implemented
  • ❌ Function should probably not be implemented (reason given)
  • ❔ Undecided

Some functions are defined in libgit2 headers in the sys subdirectory, and are not reachable from a standard include (i.e. #include "git2.h"). For now, we will skip those on the assumption that they are more specialized.

Estimates (updated periodically):

  • Implemented: 325 (41.8%)
  • Should not implement: 169 (21.7%)
  • To do: 284 (36.5%)
  • Total: 778

extra

These are functions that do not have a libgit2 equivalent.

Type checkers and predicates:

  • ✔️ git-typeof
  • ✔️ git-blame-p
  • ✔️ git-commit-p
  • ✔️ git-cred-p
  • ✔️ git-diff-p
  • ✔️ git-diff-delta-p
  • ✔️ git-diff-binary-p
  • ✔️ git-diff-hunk-p
  • ✔️ git-diff-line-p
  • ✔️ git-index-p
  • ✔️ git-index-entry-p
  • ✔️ git-object-p
  • ✔️ git-reference-p
  • ✔️ git-repository-p
  • ✔️ git-signature-p
  • ✔️ git-reference-direct-p
  • ✔️ git-reference-symbolic-p
  • ✔️ git-transaction-p
  • ✔️ git-tree-p

Getters for public structs:

  • ✔️ git-blame-hunk-commit-id
  • ✔️ git-blame-hunk-lines
  • ✔️ git-blame-hunk-orig-path
  • ✔️ git-blame-hunk-signature
  • ✔️ git-blame-hunk-start-line-number
  • ✔️ git-diff-delta-file-id
  • ✔️ git-diff-delta-file-path
  • ✔️ git-diff-delta-nfiles
  • ✔️ git-diff-delta-similarity
  • ✔️ git-diff-delta-status
  • ✔️ git-diff-delta-file-exists-p
  • ✔️ git-diff-hunk-header
  • ✔️ git-diff-hunk-lines
  • ✔️ git-diff-hunk-start
  • ✔️ git-diff-line-origin
  • ✔️ git-diff-line-lineno
  • ✔️ git-diff-line-content
  • ✔️ git-index-entry-path
  • ✔️ git-signature-name
  • ✔️ git-signature-email
  • ✔️ git-signature-time

Iterators converted to map functions:

  • ✔️ git-branch-foreach
  • ✔️ git-index-conflict-foreach

annotated

  • git-annotated-commit-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-annotated-commit-from-fetchhead
  • ✔️ git-annotated-commit-from-ref
  • ✔️ git-annotated-commit-from-revspec
  • ✔️ git-annotated-commit-id
  • ✔️ git-annotated-commit-lookup

attr

  • git-attr-add-macro
  • git-attr-cache-flush
  • git-attr-foreach
  • git-attr-get
  • git-attr-get-many
  • git-attr-value

blame

  • git-blame-buffer
  • ✔️ git-blame-file
  • git-blame-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-blame-get-hunk-byindex
  • ✔️ git-blame-get-hunk-byline
  • ✔️ git-blame-get-hunk-count
  • git-blame-init-options (options are represented by an alist)

blob

  • ✔️ git-blob-create-frombuffer
  • ✔️ git-blob-create-fromdisk
  • git-blob-create-fromstream
  • git-blob-create-fromstream-commit
  • ✔️ git-blob-create-fromworkdir
  • git-blob-dup
  • ✔️ git-blob-filtered-content
  • git-blob-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-blob-id
  • ✔️ git-blob-is-binary (as libgit-blob-binary-p)
  • ✔️ git-blob-lookup
  • ✔️ git-blob-lookup-prefix
  • ✔️ git-blob-owner
  • ✔️ git-blob-rawcontent
  • ✔️ git-blob-rawsize

branch

  • ✔️ git-branch-create
  • ✔️ git-branch-create-from-annotated
  • ✔️ git-branch-delete
  • ✔️ git-branch-is-checked-out
  • ✔️ git-branch-is-head
  • git-branch-iterator-free
  • git-branch-iterator-new
  • ✔️ git-branch-lookup
  • ✔️ git-branch-move
  • ✔️ git-branch-name
  • git-branch-next
  • ✔️ git-branch-remote-name
  • ✔️ git-branch-set-upstream
  • ✔️ git-branch-upstream
  • ✔️ git-branch-upstream-name
  • ✔️ git-branch-upstream-remote

buf

Probably none of these functions are necessary, since we can expose buffers to Emacs as strings.

  • git-buf-contains-nul
  • git-buf-free (memory management shouldn't be exposed to Emacs)
  • git-buf-grow
  • git-buf-is-binary
  • git-buf-set

checkout

  • ✔️ git-checkout-head
  • ✔️ git-checkout-index
  • git-checkout-init-options
  • ✔️ git-checkout-tree

cherrypick

  • ✔️ git-cherrypick
  • ✔️ git-cherrypick-commit
  • git-cherrypick-init-options

clone

  • ✔️ git-clone
  • git-clone-init-options

commit

  • git-commit-amend
  • ✔️ git-commit-author
  • ✔️ git-commit-body
  • ✔️ git-commit-committer
  • ✔️ git-commit-create
  • git-commit-create-buffer
  • git-commit-create-from-callback (in sys)
  • git-commit-create-from-ids (in sys)
  • git-commit-create-v (git-commit-create does the same)
  • git-commit-create-with-signature
  • git-commit-dup
  • git-commit-extract-signature
  • git-commit-free (memory management shouldn't be exposed to Emacs)
  • git-commit-header-field
  • ✔️ git-commit-id
  • ✔️ git-commit-lookup
  • ✔️ git-commit-lookup-prefix
  • ✔️ git-commit-message
  • git-commit-message-encoding
  • git-commit-message-raw
  • ✔️ git-commit-nth-gen-ancestor
  • ✔️ git-commit-owner
  • ✔️ git-commit-parent
  • ✔️ git-commit-parent-id
  • ✔️ git-commit-parentcount
  • git-commit-raw-header
  • ✔️ git-commit-summary
  • ✔️ git-commit-time
  • git-commit-time-offset (included in git-commit-time)
  • ✔️ git-commit-tree
  • ✔️ git-commit-tree-id

config

  • git-config-add-backend (in sys)
  • ✔️ git-config-add-file-ondisk
  • git-config-backend-foreach-match
  • ✔️ git-config-delete-entry
  • ✔️ git-config-delete-multivar
  • git-config-entry-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-config-find-global
  • ✔️ git-config-find-programdata
  • ✔️ git-config-find-system
  • ✔️ git-config-find-xdg
  • git-config-foreach
  • git-config-foreach-match
  • git-config-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-config-get-bool
  • git-config-get-entry
  • git-config-get-int32 (don't need different integer types)
  • ✔️ git-config-get-int64 (as -int)
  • git-config-get-mapped
  • git-config-get-multivar-foreach
  • ✔️ git-config-get-path
  • ✔️ git-config-get-string
  • git-config-get-string-buf (probably fine with just -get-string)
  • git-config-init-backend (in sys)
  • git-config-iterator-free (memory management shouldn't be exposed to Emacs)
  • git-config-iterator-glob-new
  • git-config-iterator-new
  • ✔️ git-config-lock
  • git-config-lookup-map-value
  • git-config-multivar-iterator-new
  • ✔️ git-config-new
  • git-config-next
  • ✔️ git-config-open-default
  • ✔️ git-config-open-global
  • ✔️ git-config-open-level
  • ✔️ git-config-open-ondisk
  • git-config-parse-bool
  • git-config-parse-int32
  • git-config-parse-int64
  • git-config-parse-path
  • ✔️ git-config-set-bool
  • git-config-set-int32 (don't need different integer types)
  • ✔️ git-config-set-int64 (as -int)
  • git-config-set-multivar
  • ✔️ git-config-set-string
  • ✔️ git-config-snapshot

cred

  • ✔️ git-cred-default-new
  • git-cred-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-cred-has-username (git-cred-username-p)
  • git-cred-ssh-custom-new
  • git-cred-ssh-interactive-new
  • ✔️ git-cred-ssh-key-from-agent
  • ✔️ git-cred-ssh-key-memory-new
  • ✔️ git-cred-ssh-key-new
  • ✔️ git-cred-username-new
  • git-cred-userpass (stock callback)
  • ✔️ git-cred-userpass-plaintext-new

describe

  • ✔️ git-describe-commit
  • git-describe-format (we return strings immediately)
  • git-describe-result-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-describe-workdir

diff

  • git-diff-blob-to-buffer
  • git-diff-blobs
  • git-diff-buffers
  • git-diff-commit-as-email
  • git-diff-find-init-options
  • ✔️ git-diff-find-similar
  • ✔️ git-diff-foreach
  • git-diff-format-email
  • git-diff-format-email-init-options
  • git-diff-free (memory management shouldn't be exposed to Emacs)
  • git-diff-from-buffer
  • ✔️ git-diff-get-delta
  • git-diff-get-perfdata (in sys)
  • git-diff-get-stats
  • ✔️ git-diff-index-to-index
  • ✔️ git-diff-index-to-workdir
  • git-diff-init-options
  • git-diff-is-sorted-icase
  • git-diff-merge
  • ✔️ git-diff-num-deltas
  • ✔️ git-diff-num-deltas-of-type (use git-diff-num-deltas)
  • git-diff-patchid
  • git-diff-patchid-init-options
  • ✔️ git-diff-print
  • git-diff-print-callback--to-buf (in sys)
  • git-diff-print-callback--to-file-handle
  • git-diff-stats-deletions
  • git-diff-stats-files-changed
  • git-diff-stats-free (memory management shouldn't be exposed to Emacs)
  • git-diff-stats-insertions
  • git-diff-stats-to-buf
  • git-diff-status-char
  • git-diff-to-buf
  • ✔️ git-diff-tree-to-index
  • ✔️ git-diff-tree-to-tree
  • ✔️ git-diff-tree-to-workdir
  • ✔️ git-diff-tree-to-workdir-with-index

fetch

  • git-fetch-init-options

filter

  • git-filter-init (in sys)
  • git-filter-list-apply-to-blob
  • git-filter-list-apply-to-data
  • git-filter-list-apply-to-file
  • git-filter-list-contains
  • git-filter-list-free (memory management shouldn't be exposed to Emacs)
  • git-filter-list-length (in sys)
  • git-filter-list-load
  • git-filter-list-new (in sys)
  • git-filter-list-push (in sys)
  • git-filter-list-stream-blob
  • git-filter-list-stream-data
  • git-filter-list-stream-file
  • git-filter-lookup (in sys)
  • git-filter-register (in sys)
  • git-filter-source-filemode (in sys)
  • git-filter-source-flags (in sys)
  • git-filter-source-id (in sys)
  • git-filter-source-mode (in sys)
  • git-filter-source-path (in sys)
  • git-filter-source-repo (in sys)
  • git-filter-unregister (in sys)

giterr

Probably none of these functions will be necessary, since we expose errors to Emacs as signals.

  • giterr-clear
  • giterr-last
  • giterr-set-oom
  • giterr-set-str

graph

  • ✔️ git-graph-ahead-behind
  • ✔️ git-graph-descendant-of

hashsig

  • git-hashsig-compare (in sys)
  • git-hashsig-create (in sys)
  • git-hashsig-create-fromfile (in sys)
  • git-hashsig-free (memory management shouldn't be exposed to Emacs)

ignore

  • ✔️ git-ignore-add-rule
  • ✔️ git-ignore-clear-internal-rules
  • ✔️ git-ignore-path-is-ignored

index

  • git-index-add
  • ✔️ git-index-add-all
  • ✔️ git-index-add-bypath
  • git-index-add-frombuffer
  • ✔️ git-index-caps
  • ✔️ git-index-checksum
  • ✔️ git-index-clear
  • git-index-conflict-add
  • git-index-conflict-cleanup
  • ✔️ git-index-conflict-get
  • ✔️ git-index-conflict-iterator-free (use git-index-conflict-foreach)
  • ✔️ git-index-conflict-iterator-new (use git-index-conflict-foreach)
  • ✔️ git-index-conflict-next (use git-index-conflict-foreach)
  • git-index-conflict-remove
  • ✔️ git-index-entry-is-conflict (use git-index-entry-stage)
  • ✔️ git-index-entry-stage
  • ✔️ git-index-entrycount
  • git-index-find
  • git-index-find-prefix
  • git-index-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-index-get-byindex
  • ✔️ git-index-get-bypath
  • ✔️ git-index-has-conflicts (as git-index-conflicts-p)
  • git-index-new
  • git-index-open
  • ✔️ git-index-owner
  • ✔️ git-index-path
  • ✔️ git-index-read
  • git-index-read-tree
  • git-index-remove
  • git-index-remove-all
  • git-index-remove-bypath
  • git-index-remove-directory
  • git-index-set-caps
  • git-index-set-version
  • git-index-update-all
  • ✔️ git-index-version
  • ✔️ git-index-write
  • ✔️ git-index-write-tree
  • ✔️ git-index-write-tree-to (use git-index-write-tree)

indexer

  • git-indexer-append
  • git-indexer-commit
  • git-indexer-free (memory management shouldn't be exposed to Emacs)
  • git-indexer-hash
  • git-indexer-new

libgit2

  • ✔️ git-libgit2-features (as libgit-feature-p)
  • git-libgit2-init (internal)
  • git-libgit2-opts
  • git-libgit2-shutdown (internal)
  • ✔️ git-libgit2-version (as libgit-version)

mempack

  • git-mempack-dump (in sys)
  • git-mempack-new (in sys)
  • git-mempack-reset (in sys)

merge

  • ✔️ git-merge
  • ✔️ git-merge-analysis
  • ✔️ git-merge-base
  • ✔️ git-merge-base-many (use git-merge-base)
  • ✔️ git-merge-base-octopus
  • ✔️ git-merge-bases
  • ✔️ git-merge-bases-many (use git-merge-bases)
  • git-merge-commits
  • git-merge-file
  • git-merge-file-from-index
  • git-merge-file-init-input
  • git-merge-file-init-options
  • git-merge-file-result-free
  • git-merge-init-options
  • git-merge-trees

message

  • ✔️ git-message-prettify
  • git-message-trailer-array-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-message-trailers

note

  • git-note-author
  • git-note-commit-create
  • git-note-commit-iterator-new
  • git-note-commit-read
  • git-note-commit-remove
  • git-note-committer
  • git-note-create
  • git-note-foreach
  • git-note-free (memory management shouldn't be exposed to Emacs)
  • git-note-id
  • git-note-iterator-free
  • git-note-iterator-new
  • git-note-message
  • git-note-next
  • git-note-read
  • git-note-remove

object

  • git-object--size (memory management shouldn't be exposed to Emacs)
  • git-object-dup
  • git-object-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-object-id
  • git-object-lookup
  • ✔️ git-object-lookup-bypath
  • ✔️ git-object-lookup-prefix
  • ✔️ git-object-owner
  • git-object-peel
  • ✔️ git-object-short-id
  • git-object-string2type (see below)
  • git-object-type (can be covered by a more general git-typeof for all opaque user pointers)
  • git-object-type2string (see above)
  • git-object-typeisloose

odb

  • git-odb-add-alternate
  • git-odb-add-backend
  • git-odb-add-disk-alternate
  • git-odb-backend-loose
  • git-odb-backend-one-pack
  • git-odb-backend-pack
  • git-odb-exists
  • git-odb-exists-prefix
  • git-odb-expand-ids
  • git-odb-foreach
  • git-odb-free (memory management shouldn't be exposed to Emacs)
  • git-odb-get-backend
  • git-odb-hash
  • git-odb-hashfile
  • git-odb-init-backend (in sys)
  • git-odb-new
  • git-odb-num-backends
  • git-odb-object-data
  • git-odb-object-dup
  • git-odb-object-free (memory management shouldn't be exposed to Emacs)
  • git-odb-object-id
  • git-odb-object-size
  • git-odb-object-type
  • git-odb-open
  • git-odb-open-rstream
  • git-odb-open-wstream
  • git-odb-read
  • git-odb-read-header
  • git-odb-read-prefix
  • git-odb-refresh
  • git-odb-stream-finalize-write
  • git-odb-stream-free (memory management shouldn't be exposed to Emacs)
  • git-odb-stream-read
  • git-odb-stream-write
  • git-odb-write
  • git-odb-write-pack

oid

Probably none of these functions will be necessary, since we can expose OIDs to Emacs as strings.

  • git-oid-cmp
  • git-oid-cpy
  • git-oid-equal
  • git-oid-fmt
  • git-oid-fromraw
  • git-oid-fromstr
  • git-oid-fromstrn
  • git-oid-fromstrp
  • git-oid-iszero
  • git-oid-ncmp
  • git-oid-nfmt
  • git-oid-pathfmt
  • git-oid-shorten-add
  • git-oid-shorten-free
  • git-oid-shorten-new
  • git-oid-strcmp
  • git-oid-streq
  • git-oid-tostr
  • git-oid-tostr-s

oidarray

  • git-oidarray-free (memory management shouldn't be exposed to Emacs)

openssl

  • git-openssl-set-locking (in sys)

packbuilder

  • git-packbuilder-foreach
  • git-packbuilder-free (memory management shouldn't be exposed to Emacs)
  • git-packbuilder-hash
  • git-packbuilder-insert
  • git-packbuilder-insert-commit
  • git-packbuilder-insert-recur
  • git-packbuilder-insert-tree
  • git-packbuilder-insert-walk
  • git-packbuilder-new
  • git-packbuilder-object-count
  • git-packbuilder-set-callbacks
  • git-packbuilder-set-threads
  • git-packbuilder-write
  • git-packbuilder-written

patch

  • git-patch-free (memory management shouldn't be exposed to Emacs)
  • git-patch-from-blob-and-buffer
  • git-patch-from-blobs
  • git-patch-from-buffers
  • git-patch-from-diff
  • git-patch-get-delta
  • git-patch-get-hunk
  • git-patch-get-line-in-hunk
  • git-patch-line-stats
  • git-patch-num-hunks
  • git-patch-num-lines-in-hunk
  • git-patch-print
  • git-patch-size
  • git-patch-to-buf

pathspec

  • git-pathspec-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-pathspec-match-diff
  • ✔️ git-pathspec-match-index
  • ✔️ git-pathspec-match-list-diff-entry
  • ✔️ git-pathspec-match-list-entry
  • ✔️ git-pathspec-match-list-entrycount
  • ✔️ git-pathspec-match-list-failed-entry
  • ✔️ git-pathspec-match-list-failed-entrycount
  • git-pathspec-match-list-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-pathspec-match-tree
  • ✔️ git-pathspec-match-workdir
  • ✔️ git-pathspec-matches-path
  • ✔️ git-pathspec-new

proxy

  • git-proxy-init-options

push

  • git-push-init-options

rebase

  • git-rebase-abort
  • git-rebase-commit
  • git-rebase-finish
  • git-rebase-free (memory management shouldn't be exposed to Emacs)
  • git-rebase-init
  • git-rebase-init-options
  • git-rebase-inmemory-index
  • git-rebase-next
  • git-rebase-open
  • git-rebase-operation-byindex
  • git-rebase-operation-current
  • git-rebase-operation-entrycount

refdb

  • git-refdb-backend-fs (in sys)
  • git-refdb-compress
  • git-refdb-free (memory management shouldn't be exposed to Emacs)
  • git-refdb-init-backend (in sys)
  • git-refdb-new
  • git-refdb-open
  • git-refdb-set-backend (in sys)

reference

  • git-reference--alloc (in sys)
  • git-reference--alloc-symbolic (in sys)
  • git-reference-cmp
  • ✔️ git-reference-create
  • ✔️ git-reference-create-matching
  • ✔️ git-reference-delete
  • ✔️ git-reference-dup
  • ✔️ git-reference-dwim
  • ✔️ git-reference-ensure-log
  • ✔️ git-reference-foreach
  • ✔️ git-reference-foreach-glob
  • ✔️ git-reference-foreach-name
  • git-reference-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-reference-has-log
  • ✔️ git-reference-is-branch
  • ✔️ git-reference-is-note
  • ✔️ git-reference-is-remote
  • ✔️ git-reference-is-tag
  • ✔️ git-reference-is-valid-name
  • git-reference-iterator-free (use the foreach functions)
  • git-reference-iterator-glob-new (use the foreach functions)
  • git-reference-iterator-new (use the foreach functions)
  • ✔️ git-reference-list
  • ✔️ git-reference-lookup
  • ✔️ git-reference-name
  • ✔️ git-reference-name-to-id
  • git-reference-next (use the foreach functions)
  • git-reference-next-name (use the foreach functions)
  • git-reference-normalize-name
  • ✔️ git-reference-owner
  • ✔️ git-reference-peel
  • ✔️ git-reference-remove
  • git-reference-rename
  • ✔️ git-reference-resolve
  • git-reference-set-target
  • ✔️ git-reference-shorthand
  • git-reference-symbolic-create
  • git-reference-symbolic-create-matching
  • git-reference-symbolic-set-target
  • ✔️ git-reference-symbolic-target
  • ✔️ git-reference-target
  • ✔️ git-reference-target-peel
  • ✔️ git-reference-type

reflog

  • ✔️ git-reflog-append
  • ✔️ git-reflog-delete
  • ✔️ git-reflog-drop
  • ✔️ git-reflog-entry-byindex
  • ✔️ git-reflog-entry-committer
  • ✔️ git-reflog-entry-id-new (use git-reflog-entry-id)
  • ✔️ git-reflog-entry-id-old (use git-reflog-entry-id)
  • ✔️ git-reflog-entry-message
  • ✔️ git-reflog-entrycount
  • git-reflog-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-reflog-read
  • ✔️ git-reflog-rename
  • ✔️ git-reflog-write

refspec

  • ✔️ git-refspec-direction
  • ✔️ git-refspec-dst
  • ✔️ git-refspec-dst-matches
  • ✔️ git-refspec-force
  • git-refspec-rtransform
  • ✔️ git-refspec-src
  • ✔️ git-refspec-src-matches
  • ✔️ git-refspec-string
  • git-refspec-transform

remote

  • ✔️ git-remote-add-fetch (use git-remote-add-refspec)
  • ✔️ git-remote-add-push (use git-remote-add-refspec)
  • ✔️ git-remote-autotag
  • git-remote-connect
  • git-remote-connected
  • ✔️ git-remote-create
  • git-remote-create-anonymous
  • git-remote-create-detached
  • git-remote-create-with-fetchspec
  • git-remote-default-branch
  • git-remote-delete
  • git-remote-disconnect
  • git-remote-download
  • git-remote-dup
  • ✔️ git-remote-fetch
  • git-remote-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-remote-get-fetch-refspecs (use git-remote-get-refspecs)
  • ✔️ git-remote-get-push-refspecs (use git-remote-get-refspecs)
  • ✔️ git-remote-get-refspec
  • git-remote-init-callbacks
  • ✔️ git-remote-is-valid-name
  • ✔️ git-remote-list
  • ✔️ git-remote-lookup
  • git-remote-ls
  • ✔️ git-remote-name
  • ✔️ git-remote-owner
  • git-remote-prune
  • git-remote-prune-refs
  • ✔️ git-remote-push
  • ✔️ git-remote-pushurl
  • ✔️ git-remote-refspec-count
  • git-remote-rename
  • git-remote-set-autotag
  • git-remote-set-pushurl
  • git-remote-set-url
  • git-remote-stats
  • git-remote-stop
  • git-remote-update-tips
  • git-remote-upload
  • ✔️ git-remote-url

repository

  • git-repository--cleanup (in sys)
  • ✔️ git-repository-commondir
  • ✔️ git-repository-config
  • git-repository-config-snapshot
  • ✔️ git-repository-detach-head
  • ✔️ git-repository-discover
  • git-repository-fetchhead-foreach
  • git-repository-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-repository-get-namespace
  • git-repository-hashfile
  • ✔️ git-repository-head
  • ✔️ git-repository-head-detached
  • ✔️ git-repository-head-for-worktree
  • ✔️ git-repository-head-unborn
  • ✔️ git-repository-ident
  • ✔️ git-repository-index
  • ✔️ git-repository-init
  • git-repository-init-ext
  • git-repository-init-init-options
  • ✔️ git-repository-is-bare
  • ✔️ git-repository-is-empty
  • ✔️ git-repository-is-shallow
  • ✔️ git-repository-is-worktree
  • git-repository-item-path
  • git-repository-mergehead-foreach
  • ✔️ git-repository-message
  • ✔️ git-repository-message-remove
  • git-repository-new (in sys)
  • git-repository-odb
  • ✔️ git-repository-open
  • ✔️ git-repository-open-bare
  • git-repository-open-ext
  • git-repository-open-from-worktree
  • ✔️ git-repository-path
  • git-repository-refdb
  • git-repository-reinit-filesystem (in sys)
  • git-repository-set-bare (in sys)
  • git-repository-set-config (in sys)
  • ✔️ git-repository-set-head
  • ✔️ git-repository-set-head-detached
  • git-repository-set-head-detached-from-annotated
  • ✔️ git-repository-set-ident
  • git-repository-set-index (in sys)
  • ✔️ git-repository-set-namespace
  • git-repository-set-odb (in sys)
  • git-repository-set-refdb (in sys)
  • ✔️ git-repository-set-workdir
  • ✔️ git-repository-state
  • ✔️ git-repository-state-cleanup
  • git-repository-submodule-cache-all (in sys)
  • git-repository-submodule-cache-clear (in sys)
  • ✔️ git-repository-workdir
  • git-repository-wrap-odb

reset

  • ✔️ git-reset
  • ✔️ git-reset-default
  • ✔️ git-reset-from-annotated

revert

  • ✔️ git-revert
  • ✔️ git-revert-commit
  • git-revert-init-options

revparse

  • ✔️ git-revparse
  • ✔️ git-revparse-ext
  • ✔️ git-revparse-single

revwalk

  • git-revwalk-add-hide-cb (use git-revwalk-foreach)
  • git-revwalk-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-revwalk-hide
  • ✔️ git-revwalk-hide-glob
  • ✔️ git-revwalk-hide-head
  • ✔️ git-revwalk-hide-ref
  • ✔️ git-revwalk-new
  • git-revwalk-next (use git-revwalk-foreach)
  • ✔️ git-revwalk-push
  • ✔️ git-revwalk-push-glob
  • ✔️ git-revwalk-push-head
  • ✔️ git-revwalk-push-range
  • ✔️ git-revwalk-push-ref
  • ✔️ git-revwalk-repository
  • ✔️ git-revwalk-reset
  • ✔️ git-revwalk-simplify-first-parent
  • ✔️ git-revwalk-sorting

signature

  • ✔️ git-signature-default
  • git-signature-dup
  • git-signature-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-signature-from-buffer (use git-signature-from-string)
  • ✔️ git-signature-new
  • ✔️ git-signature-now

smart

  • git-smart-subtransport-git
  • git-smart-subtransport-http
  • git-smart-subtransport-ssh

stash

  • git-stash-apply
  • git-stash-apply-init-options
  • git-stash-drop
  • git-stash-foreach
  • git-stash-pop

status

  • git-status-byindex
  • ✔️ git-status-file
  • ✔️ git-status-foreach
  • ✔️ git-status-foreach-ext
  • git-status-init-options
  • git-status-list-entrycount
  • git-status-list-free
  • git-status-list-get-perfdata (in sys)
  • git-status-list-new
  • ✔️ git-status-should-ignore

strarray

  • git-strarray-copy
  • git-strarray-free (memory management shouldn't be exposed to Emacs)

stream

  • git-stream-register-tls (in sys)

submodule

  • ✔️ git-submodule-add-finalize
  • ✔️ git-submodule-add-setup
  • ✔️ git-submodule-add-to-index
  • ✔️ git-submodule-branch
  • ✔️ git-submodule-fetch-recurse-submodules
  • ✔️ git-submodule-foreach
  • git-submodule-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-submodule-head-id
  • ✔️ git-submodule-ignore
  • ✔️ git-submodule-index-id
  • ✔️ git-submodule-init
  • ✔️ git-submodule-location
  • ✔️ git-submodule-lookup
  • ✔️ git-submodule-name
  • ✔️ git-submodule-open
  • ✔️ git-submodule-owner
  • ✔️ git-submodule-path
  • ✔️ git-submodule-reload
  • ✔️ git-submodule-repo-init
  • git-submodule-resolve-url
  • ✔️ git-submodule-set-branch
  • ✔️ git-submodule-set-fetch-recurse-submodules
  • ✔️ git-submodule-set-ignore
  • ✔️ git-submodule-set-update
  • ✔️ git-submodule-set-url
  • ✔️ git-submodule-status
  • ✔️ git-submodule-sync
  • ✔️ git-submodule-update
  • git-submodule-update-init-options
  • ✔️ git-submodule-update-strategy
  • ✔️ git-submodule-url
  • ✔️ git-submodule-wd-id

tag

  • git-tag-annotation-create
  • git-tag-create
  • git-tag-create-frombuffer
  • git-tag-create-lightweight
  • git-tag-delete
  • git-tag-dup
  • ✔️ git-tag-foreach
  • git-tag-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-tag-id
  • ✔️ git-tag-list
  • ✔️ git-tag-list-match
  • ✔️ git-tag-lookup
  • ✔️ git-tag-lookup-prefix
  • ✔️ git-tag-message
  • ✔️ git-tag-name
  • ✔️ git-tag-owner
  • ✔️ git-tag-peel
  • ✔️ git-tag-tagger
  • ✔️ git-tag-target
  • ✔️ git-tag-target-id
  • ✔️ git-tag-target-type

time

  • git-time-monotonic (in sys)

trace

  • git-trace-set

transaction

  • ✔️ git_transaction_commit
  • git_transaction_free (memory management shouldn't be exposed to Emacs)
  • git_transaction_lock_ref
  • git_transaction_new
  • git_transaction_remove
  • git_transaction_set_reflog
  • git_transaction_set_symbolic_target
  • git_transaction_set_target

transport

  • git-transport-dummy (in sys)
  • git-transport-init (in sys)
  • git-transport-local (in sys)
  • git-transport-new (in sys)
  • git-transport-register (in sys)
  • git-transport-smart (in sys)
  • git-transport-smart-certificate-check (in sys)
  • git-transport-smart-credentials (in sys)
  • git-transport-smart-proxy-options (in sys)
  • git-transport-ssh-with-paths (in sys)
  • git-transport-unregister (in sys)

tree

  • git-tree-create-updated
  • git-tree-dup
  • ✔️ git-tree-entry-byid
  • ✔️ git-tree-entry-byindex
  • ✔️ git-tree-entry-byname
  • ✔️ git-tree-entry-bypath
  • git-tree-entry-cmp (tree entries are exposed to emacs as lists)
  • git-tree-entry-dup (tree entries are exposed to emacs as lists)
  • git-tree-entry-filemode (tree entries are exposed to emacs as lists)
  • git-tree-entry-filemode-raw (tree entries are exposed to emacs as lists)
  • git-tree-entry-free (memory management shouldn't be exposed to Emacs)
  • git-tree-entry-id (tree entries are exposed to emacs as lists)
  • git-tree-entry-name (tree entries are exposed to emacs as lists)
  • git-tree-entry-to-object (tree entries are exposed to emacs as lists)
  • git-tree-entry-type (tree entries are exposed to emacs as lists)
  • ✔️ git-tree-entrycount
  • git-tree-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-tree-id
  • ✔️ git-tree-lookup
  • ✔️ git-tree-lookup-prefix
  • ✔️ git-tree-owner
  • ✔️ git-tree-walk

treebuilder

  • ✔️ git-treebuilder-clear
  • ✔️ git-treebuilder-entrycount
  • ✔️ git-treebuilder-filter
  • git-treebuilder-free (memory management shouldn't be exposed to Emacs)
  • ✔️ git-treebuilder-get
  • ✔️ git-treebuilder-insert
  • ✔️ git-treebuilder-new
  • ✔️ git-treebuilder-remove
  • ✔️ git-treebuilder-write
  • git-treebuilder-write-with-buffer

worktree

  • git-worktree-add
  • git-worktree-add-init-options
  • git-worktree-free (memory management shouldn't be exposed to Emacs)
  • git-worktree-is-locked
  • git-worktree-is-prunable
  • git-worktree-list
  • git-worktree-lock
  • git-worktree-lookup
  • git-worktree-open-from-repository
  • git-worktree-prune
  • git-worktree-prune-init-options
  • git-worktree-unlock
  • git-worktree-validate