<commit_before>(*
 * Copyright (c) 2013-2017 <NAME> <<EMAIL>>
 * and <NAME> <<EMAIL>>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *)

(** The Git Reference module. *)

type t = private string
(** A Git Reference object. Which contains a hash to point to an other object. *)


val head : t
(** [head] is the {i user-friendly} value of HEAD Git reference. *)

val master : t
(** [master] is the {i user-friendly} value of [refs/heads/master] Git
    reference. *)

val is_head : t -> bool
(** [is_head t] returns [true] if [t = head]. *)

val of_string : string -> t
(** [of_string s] returns a valid reference value. A valid value means:

    A [refname] is a hierarchical octet string beginning with ["refs/"] and not
    violating the [git-check-ref-format] command's validation rules. More
    specifically, they:

    - They can include slash ['/'] for hierarchical (directory) grouping, but no
      slash-separated component can begin with a dot ['.'].
    - They must contain at least one ['/']. This enforces the presence of a
      category like ["heads/"], ["tags/"] etc. but the actual names are not
      restricted.
    - They cannot have two consecutive dots [".."] anywhere.
    - They cannot have ASCII control characters (i.e. bytes whose values are
      lower than [\040] or [\177] DEL), space, tilde ['~'], caret ['^'], colon
      [':'], question-mark ['?'], asterisk ['*'], or open bracket ['\[']
      anywhere.
    - They cannot end with a slash ['/'] or a dot ['.'].
    - They cannot end with the sequence [".lock"].
    - They cannot contain a sequence ["@{"].
    - They cannot contain a ['\\']. *)

val to_string : t -> string
(** [to_string t] returns the string value of the reference [t]. *)

val of_path : Path.t -> t
(** [of_path path] casts a path to a reference. *)

val to_path : t -> Path.t
(** [to_path ref] casts a reference [ref] to a path (as a Window path or Unix
    path). *)

(** Interface to describe the Git reference value [head_contents]. *)
module type S = sig
  module Hash : S.HASH<commit_msg>Delete the old interface of Git reference<commit_after>(*
 * Copyright (c) 2013-2017 <NAME> <<EMAIL>>
 * and <NAME> <<EMAIL>>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *)

(** The Git Reference module. *)


(** Interface to describe the Git reference value [head_contents]. *)
module type S = sig
  module Hash : S.HASH
{'fraction_non_alphanumeric': 0.10406634563937935, 'fraction_numerical': 0.005885500267522739, 'mean_word_length': 3.5157004830917873, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3671764', 'n_tokens_mistral': 1091, 'n_tokens_neox': 990, 'n_words': 526}