Xgit v0.8.0 Xgit.Repository View Source

Represents a git repository.

Create a repository by calling the start_link function on one of the modules that implements Xgit.Repository.Storage. The resulting PID can be used when calling functions in this module and Xgit.Repository.Plumbing.

The functions implemented in this module correspond to the "porcelain" commands implemented by command-line git.

(As of this writing, relatively few of the porcelain commands are implemented.)

Link to this section Summary

Types

t()

The process ID for an Xgit.Repository process.

Reason codes that can be returned by tag/4.

Functions

Returns true if the argument is a PID representing a valid Xgit.Repository process.

Link to this section Types

The process ID for an Xgit.Repository process.

This is the same process ID returned from the start_link function of any module that implements Xgit.Repository.Storage.

Reason codes that can be returned by tag/4.

Link to this section Functions

Link to this function

tag(repository, tag_name, object, options \\ [])

View Source
tag(repository :: t(), tag_name :: String.t(), object :: Xgit.ObjectId.t(),
  annotated?: boolean(),
  force?: boolean(),
  message: [byte()] | String.t(),
  tagger: Xgit.PersonIdent.t()
) :: :ok | {:error, reason :: tag_reason()}

Create a tag object.

Analogous to the create form of git tag.

Parameters

repository is the Xgit.Repository.Storage (PID) to search for the object.

tag_name (String) is the name to give to the new tag.

object (Xgit.ObjectId) is the object ID to be pointed to by this tag (typically a commit object).

Options

annotated?: (boolean) true to create an annotated tag (default: false unless message is specified)

force?: (boolean) true to replace an existing tag (default: false)

message: (String or bytelist) message to associate with the tag.

  • Must be present and non-empty if :annotated? is true.
  • Implies annotated?: true.

tagger: (Xgit.PersonIdent, required if annotated) tagger name, email, timestamp

Return Value

:ok if created successfully.

{:error, reason} if unable. Reason codes may come from Xgit.Repository.Storage.put_ref/3.

TO DO: Support GPG signatures. https://github.com/elixir-git/xgit/issues/202

Link to this function

valid?(repository)

View Source
valid?(repository :: term()) :: boolean()

Returns true if the argument is a PID representing a valid Xgit.Repository process.