Module Topkg.Vcs
Version control system repositories.
Version control system repositories
val pp_kind : Stdlib.Format.formatter -> kind -> unitpp_kind ppf kprints an unspecified representation ofkonppf.
type commit_ish= stringThe 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.
val cmd : t -> Cmd.tcmd ris the base VCS command to use to act onr.Warning Prefer the functions below to remain VCS independent.
val find : ?dir:fpath -> unit -> t option resultfind ~dir ()looks for a VCS repository in working directorydir(not the repository directory like.git, default is guessed automatically).
val pp : Stdlib.Format.formatter -> t -> unitpp ppf rprints an unspecified representation ofronppf.
Repository state
val is_dirty : t -> bool resultis_dirty risOk trueiff the working tree ofrhas uncommited changes.
val not_dirty : t -> unit resultnot_dirtyisOk ()iff the working directory ofris not dirty and an error that enjoins to stash or commit otherwise.
val file_is_dirty : t -> fpath -> bool resultfile_id_dirty r fisOk trueifffhas uncommited changes.
val head : ?dirty:bool -> t -> string resulthead ~dirty ris the HEAD commit identifier of the repositoryr. Ifdirtyistrue(default), and indicator is appended to the commit identifier if the working tree ofris_dirty.
val commit_id : ?dirty:bool -> ?commit_ish:commit_ish -> t -> string resultcommit_id ~dirty ~commit_ish ris the object name (identifier) ofcommit_ish(defaults to"HEAD"). Ifcommit_ishis"HEAD"anddirtyistrue(default) and indicator is appended to the identifier if the working tree is dirty.
val commit_ptime_s : ?commit_ish:commit_ish -> t -> int resultcommit_ptime_s t ~commit_ishis the POSIX time in seconds of commitcommit_ish(defaults to"HEAD") of repositoryr.
val describe : ?dirty:bool -> ?commit_ish:commit_ish -> t -> string resultdescribe ~dirty ~commit_ish ridentifiescommit_ish(defaults to"HEAD") using tags from the repositoryr. Ifcommit_ishis"HEAD"anddirtyistrue(default) an indicator is appended to the identifier if the working tree is dirty.
val changes : ?until:commit_ish -> t -> after:commit_ish -> (string * string) list resultchanges r ~after ~untilis the list of commits with their one-line message from commit-ishafterto commit-ishuntil(defaults to"HEAD").
Repository operations
val checkout : ?branch:string -> t -> commit_ish:commit_ish -> unit resultcheckout r ~branch commit_ishchecks outcommit_ish. Checks out in a new branchbranchif provided.
val commit_files : ?msg:string -> t -> fpath list -> unit resultcommit_files r ~msg filescommits the filefileswith messagemsg(if unspecified the VCS should prompt).
val tag : ?force:bool -> ?sign:bool -> ?msg:string -> ?commit_ish:string -> t -> string -> unit resulttag r ~force ~sign ~msg ~commit_ish ttagscommit_ishwithtand messagemsg(if unspecified the VCS should prompt). ifsignistrue(defaults tofalse) signs the tag (`Gitrepos only). Ifforceistrue(default tofalse) doesn't fail if the tag already exists.