Module branchless::git

source ·
Expand description

Tools for interfacing with the Git repository.

Structs

  • Represents a Git branch.
  • Options for Repo::cherry_pick_fast.
  • Represents a commit object in the Git object database.
  • Wrapper around the config values stored on disk for Git.
  • A wrapper around a possible value that can be set for a config key.
  • A diff between two trees/commits.
  • Path to the git executable on disk to be executed.
  • Options for invoking Git.
  • The result of invoking Git.
  • The parsed version of Git.
  • The Git index.
  • An entry in the Git index.
  • Represents the ID of a Git object.
  • A checksum of the diff induced by a given commit, used for duplicate commit detection.
  • Represents a reference to an object.
  • The name of a reference, like refs/heads/master.
  • Wrapper around git2::Repository.
  • A snapshot of information about a certain reference. Updates to the reference after this value is obtained are not reflected.
  • A version of NonZeroOid that can be serialized and deserialized. This exists in case we want to move this type (back) into a separate module which has a serde dependency in the interest of improving build times.
  • The status of a file in the repo.
  • A timestamp as used in a [Signature].
  • A tree object. Contains a mapping from name to OID.
  • A special Commit which represents the status of the working copy at a given point in time. This means that it can include changes in any stage.

Enums

Constants

  • Similarly to INDETERMINATE_EXIT_CODE, this exit code is used officially by git-bisect and others to abort the process. It’s also typically raised by the shell when the command is not found, so it’s technically ambiguous whether the command existed or not. Nonetheless, it’s intuitive for a failure to run a given command to abort the process altogether, so it shouldn’t be too confusing in practice.
  • The exit status to use when a test command intends to skip the provided commit. This exit code is used officially by several source control systems:
  • The exit status to use when a test command succeeds.

Traits

  • Read-only interface to Git’s configuration.
  • Write-only interface to Git’s configuration.

Functions

  • Filter the entries in the provided tree by only keeping the provided paths.
  • Get the paths which are different between two tree objects. This is faster than the git2 implementation, which always iterates all tree entries in all tree objects recursively.
  • Get the path to the file where the latest test command is stored.
  • Get the directory where the locks for running tests are stored.
  • Get the directory where the result of tests for a particular commit are stored. Tests are keyed by tree OID, not commit OID, so that they can be cached based on the contents of the commit, rather than its specific commit hash. This means that we can cache the results of tests for commits that have been amended or rebased.
  • Get the directory where the worktrees for running tests are stored.
  • Add the provided entries into the tree.
  • Convert a command string into a string that’s safe to use as a filename.
  • Clean up a message, removing extraneous whitespace plus comment lines starting with comment_char, and ensure that the message ends with a newline.
  • Calculate the diff between the index and the working copy.
  • Update the index. This handles updates to stages other than 0.

Type Aliases