package dune-release

  1. Overview
  2. Docs

Module Dune_release.VcsSource

VCS repositories.

VCS

Version control system repositories

Sourcemodule Tag : sig ... end
Sourcetype commit_ish = string

The type for symbols resolving to a commit. The module uses "HEAD" for specifying the current checkout; use this symbol even if the underlying VCS is `Hg.

Sourcemodule Tag_or_commit_ish : sig ... end
Sourcetype t

The type for version control systems repositories.

Sourceval cmd : t -> Bos.Cmd.t

cmd r is the base VCS command to use to act on r.

Warning Prefer the functions below to remain VCS independent.

Sourceval get : ?dir:Fpath.t -> unit -> (t, Rresult.R.msg) Rresult.result

get ~dir () looks for a VCS repository in working directory dir (not the repository directory like .git, default is guessed automatically). Returns an error if no VCS was found.

Sourceval run_git_quiet : dry_run:bool -> ?force:bool -> t -> Bos_setup.Cmd.t -> (unit, Rresult.R.msg) Rresult.result
Sourceval run_git_string : dry_run:bool -> ?force:bool -> default:(string * Bos.OS.Cmd.run_status) -> t -> Bos_setup.Cmd.t -> (string, Rresult.R.msg) Rresult.result

Repository state

Sourceval is_dirty : t -> (bool, Rresult.R.msg) Rresult.result

is_dirty r is Ok true iff the working tree of r has uncommited changes.

Sourceval commit_id : ?dirty:bool -> ?commit_ish:commit_ish -> t -> (commit_ish, Rresult.R.msg) Rresult.result

commit_id ~dirty ~commit_ish r is the object name (identifier) of commit_ish (defaults to "HEAD"). If commit_ish is "HEAD" and dirty is true (default) an indicator is appended to the identifier if the working tree is dirty.

Sourceval commit_ptime_s : dry_run:bool -> ?commit_ish:Tag_or_commit_ish.t -> t -> (int64, Rresult.R.msg) Rresult.result

commit_ptime_s t ~commit_ish is the POSIX time in seconds of commit commit_ish (defaults to "HEAD") of repository r.

Sourceval describe : ?dirty:bool -> ?commit_ish:commit_ish -> t -> (string, Rresult.R.msg) Rresult.result

describe ~dirty ~commit_ish r identifies commit_ish (defaults to "HEAD") using tags from the repository r. If commit_ish is "HEAD" and dirty is true (default) an indicator is appended to the identifier if the working tree is dirty.

Sourceval tag_exists : dry_run:bool -> t -> Tag.t -> bool
Sourceval tag_points_to : t -> Tag.t -> string option
Sourceval branch_exists : dry_run:bool -> t -> commit_ish -> bool

Repository operations

Sourceval clone : dry_run:bool -> ?force:bool -> ?branch:string -> dir:Fpath.t -> t -> (unit, Rresult.R.msg) Rresult.result

clone ~dir r clones r in directory dir.

Sourceval checkout : dry_run:bool -> ?branch:commit_ish -> t -> commit_ish:Tag_or_commit_ish.t -> (unit, Rresult.R.msg) Rresult.result

checkout r ~branch commit_ish checks out commit_ish. Checks out in a new branch branch if provided.

Sourceval change_branch : dry_run:bool -> branch:string -> t -> (unit, Rresult.R.msg) Rresult.result

change_branch ~branch r moves the head to an existing branch branch.

Sourceval tag : dry_run:bool -> ?force:bool -> ?sign:bool -> ?msg:string -> ?commit_ish:string -> t -> Tag.t -> (unit, Rresult.R.msg) Rresult.result

tag r ~force ~sign ~msg ~commit_ish t tags commit_ish with t and message msg (if unspecified the VCS should prompt). if sign is true (defaults to false) signs the tag (`Git repos only). If force is true (default to false) doesn't fail if the tag already exists.

Sourceval delete_tag : dry_run:bool -> t -> Tag.t -> (unit, Rresult.R.msg) Rresult.result

delete_tag r t deletes tag t in repo r.

Sourceval ls_remote : dry_run:bool -> t -> ?kind:[ `Branch | `Tag | `All ] -> ?filter:string -> string -> ((string * string) list, Rresult.R.msg) Rresult.result

ls_remote ~dry_run t ?filter upstream queries the remote server upstream and returns the result as a list of pairs commit_hash, ref_name. filter filters results by matching on ref names, the default is no filtering. kind filters results on their kind (branch or tag), the default is `All. Only implemented for Git.

Sourceval submodule_update : dry_run:bool -> t -> (unit, Rresult.R.msg) Rresult.result

submodule r pulls in all submodules in r. Only works for git repositories

Sourceval git_escape_tag : string -> Tag.t

Exposed for tests.

Sourceval escape_tag : t -> string -> Tag.t
Sourceval git_unescape_tag : Tag.t -> string

Exposed for tests.

Sourceval unescape_tag : t -> Tag.t -> string
OCaml

Innovation. Community. Security.