package conex

  1. Overview
  2. Docs

Diff: decode patch files into hunks.

type hunk

A hunk

val pp_hunk : Format.formatter -> hunk -> unit
type operation =
  1. | Edit of string
  2. | Rename of string * string
  3. | Delete of string
  4. | Create of string
  5. | Rename_only of string * string
val pp_operation : git:bool -> Format.formatter -> operation -> unit
val operation_eq : operation -> operation -> bool
type t = {
  1. operation : operation;
  2. hunks : hunk list;
  3. mine_no_nl : bool;
  4. their_no_nl : bool;
}

A diff is a list of hunks, and an operation.

val pp : git:bool -> Format.formatter -> t -> unit
val to_diffs : string -> t list

to_diffs str decodes the given patch into a list of diff.

val patch : string option -> t -> string option

patch data diff is data', which is the result of applying diff to data. If data' is None, it was deleted.

val ids : string -> Conex_utils.path -> t list -> (bool * Conex_utils.S.t, string) result

ids rootname keydir diffs returns whether the root file was changed, and the set of modified ids.

OCaml

Innovation. Community. Security.