package b0
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e
    
    
  doc/b0_b00_kit/B00_vcs/index.html
Module B00_vcs
Version control system (VCS) repositories.
XXX. This likely needs a cleanup design round. Also make clear that this is not command oriented but repo oriented should make things more clear.
VCS kinds
val pp_kind : kind B0_std.Fmt.tpp_kind formats types of VCS.
Version control system repositories
val repo_dir : t -> B0_std.Fpath.trepo_dir r is r's repository directory (not the working directory).
val work_dir : t -> B0_std.Fpath.twork_dir r is r's working directory. On a git bare repo this may be Fpath.null.
val repo_cmd : t -> B0_std.Cmd.trepo_cmd r is the base command to use to act on r. Use only if you need VCS specific functionality not provided by the module.
val pp : t B0_std.Fmt.tpp formats a repository.
Finding local repositories
val find : ?dir:B0_std.Fpath.t -> unit -> (t option, string) Stdlib.resultfind ~dir () finds, using VCS functionality, a repository starting in directory dir (if unspecified this is the cwd).
val get : ?dir:B0_std.Fpath.t -> unit -> (t, string) Stdlib.resultget is like find but errors if no VCS was found.
Commits
The type for symbols resolving to a commit. Important, the module uses "HEAD" for specifying the commit currently checkout in the working directory; use this symbol even if the underlying VCS is Hg.
The type for commit identifiers. Note that the module sometimes appends the string "-dirty" to these identifiers in which case they are no longer.
val head : commit_ishhead is "HEAD". A symbol to represent the commit currently checked out in the working directory.
val commit_id : 
  t ->
  dirty_mark:bool ->
  commit_ish ->
  (commit_id, string) Stdlib.resultcommit_id r ~dirty_mark ~commit_ish is the object name (identifier) of commit_ish. If commit_ish is "HEAD" and dirty_mark is true (default) and the working tree of r is_dirty, a mark gets appended to the commit identifier.
val commit_ptime_s : t -> commit_ish -> (int, string) Stdlib.resultcommit_ptime_s t commit_ish is the POSIX time in seconds of commit commit_ish of repository r.
val changes : 
  t ->
  after:commit_ish ->
  until:commit_ish ->
  ((commit_id * string) list, string) Stdlib.resultchanges r ~after ~until is the list of commits with their one-line synopsis from commit-ish after to commit-ish until.
val tracked_files : 
  t ->
  tree_ish:string ->
  (B0_std.Fpath.t list, string) Stdlib.resulttracked_files ~tree_ish r are the files tracked by the tree object tree_ish.
val commit_files : 
  ?stdout:B0_std.Os.Cmd.stdo ->
  ?stderr:B0_std.Os.Cmd.stdo ->
  ?msg:string ->
  t ->
  B0_std.Fpath.t list ->
  (unit, string) Stdlib.resultcommit_files r ~msg files commits the file files with message msg (if unspecified the VCS should prompt).
Working directory
val is_dirty : t -> (bool, string) Stdlib.resultis_dirty r is Ok true iff the working directory of r has uncommited changes.
val not_dirty : t -> (unit, string) Stdlib.resultnot_dirty is Ok () iff the working directory of r is not dirty and an error that enjoins to stash or commit otherwise.
val file_is_dirty : t -> B0_std.Fpath.t -> (bool, string) Stdlib.resultfile_is_dirty r f is Ok true iff f has uncommited changes.
val checkout : 
  ?and_branch:string ->
  t ->
  commit_ish ->
  (unit, string) Stdlib.resultcheckout r ~and_branch commit_ish checks out commit_ish in the working directory of r. Checks out in a new branch and_branch if provided. This fails if the current working directory is_dirty.
val local_clone : t -> dir:B0_std.Fpath.t -> (t, string) Stdlib.resultlocal_clone r ~dir clones r to a working directory dir and returns a repo to operate on it.
Tags
val tag : 
  ?msg:string ->
  t ->
  force:bool ->
  sign:bool ->
  commit_ish ->
  tag ->
  (unit, string) Stdlib.resulttag 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.
val describe : 
  t ->
  dirty_mark:bool ->
  commit_ish ->
  (string, string) Stdlib.resultdescribe r dirty_mark commit_ish identifies commit_ish using tags from the repository r. If commit_ish is "HEAD" and dirty_mark is true (default) and the working tree of r is_dirty, a mark gets appended to the description.
val latest_tag : t -> commit_ish -> (tag option, string) Stdlib.resultlatest_tag r commit_ish finds the latest tag in the current branch describing commit_ish.
Git specific operations
module Git : sig ... endGit specific operations.
module Hg : sig ... end