package git

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Git.PathSource

Purpose of this module is little bit hard to understand. Indeed, in the previous version of ocaml-git, we used Fpath to have a good abstraction of path in UNIX and Windows systems. However, Git keeps in some ways (INDEX file specially) the UNIX path semantic (tree and reference use it too). So, Path is an abstraction (Git-path) to keep UNIX path semantic (and the separator "/"). However, we used it in few cases.

Indeed, any interation with a FS use an Fpath and Path is used only when we talk with the Git kernel (for example, the S.fold function). The biggest differences between Fpath and Path is:

  • The empty element, that means, any Path __is__ (must be) relative with a Fpath.
  • The UNIX separator in any platform, so we need to cast a Path to an Fpath then when we want to talk with the FS.

It's really annoying to handle it like this but Windows is a shit.

Sourcetype t
Sourceval empty : t
Sourceval root : t
Sourceval v : string -> t
Sourceval add : t -> string -> t
Sourceval (/) : t -> string -> t
Sourceval append : t -> t -> t
Sourceval (//) : t -> t -> t
Sourceval (+) : Fpath.t -> t -> Fpath.t
Sourceval segs : t -> string list
Sourceval of_segs : string list -> t
Sourceval basename : t -> string
Sourceval parent : t -> t
Sourceval compare : t -> t -> int
Sourceval equal : t -> t -> bool
Sourceval pp : t Fmt.t
Sourceval to_string : t -> string
Sourceval has_ext : string -> t -> bool
Sourceval rem_ext : ?multi:bool -> t -> t