Compare commits

...

5 commits

Author SHA1 Message Date
72b9d05aa5 Prepare for release v0.1.1 2024-11-28 14:44:45 +01:00
f5281fbcb1 Merge pull request 'Adjust Git_kv.commit to report staging status' (!8) from add-commit into main
Reviewed-on: #8
2024-11-28 12:48:37 +00:00
3276c90b08 Adjust Git_kv.commit to report staging status
The implementation is a bit too naïve and will report the commit dirty
even when there are no staged changes. It only detects if we're inside a
`change_and_push`.
2024-11-28 12:33:49 +01:00
60795e65e2 Merge pull request 'add function: commit : t -> Digestif.SHA1.t option' (!6) from add-commit into main
Reviewed-on: #6
Reviewed-by: dinosaure <romain.calascibetta@gmail.com>
2024-11-28 10:44:14 +00:00
56eceb1ef2 add function: commit : t -> Digestif.SHA1.t option 2024-11-27 19:45:56 +01:00
3 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,9 @@
# v0.1.1 2024-11-28 - Vig (Denmark)
- Remove unused code from test setup (!4 - @hannesm)
- **BUG FIX**: of_octets: create ring buffer earlier to avoid missing data (!5 - @hanensm, review by @dinosaure @reynir)
- Add function `commit : t -> Digestif.SHA1.t option` (!6 !8 - @hannesm @reynir, review by @dinosaure)
# v0.1.0 2024-10-29 - Berlin (Germany) and Bamenda (Cameroon)
- Refine change_and_push semantics (fixing on GitHub #1 #2 - @reynir @dinosaure @hannesm git.robur.coop #2)

View file

@ -109,6 +109,14 @@ let connect ctx endpoint =
let branch t = t.branch
let commit t =
match t.head, t.committed with
| None, _ -> None
| Some commit, None -> Some (`Clean commit)
| Some commit, Some _ ->
(* XXX: this is not precise as we can have made zero changes *)
Some (`Dirty commit)
type key = Mirage_kv.Key.t
type change = [

View file

@ -43,6 +43,11 @@ val connect : Mimic.ctx -> string -> t Lwt.t
val branch : t -> Git.Reference.t
(** [branch t] returns the branch used by the given [t]. *)
val commit : t -> [ `Clean of Digestif.SHA1.t | `Dirty of Digestif.SHA1.t ] option
(** [commit t] returns the commit used by the given [t]. The commit is either
marked [`Dirty _] if we're inside a [change_and_push] or [`Clean _]
otherwise. *)
val to_octets : ?level:int -> t -> string Lwt_stream.t
(** [to_octets ?level store] returns a serialized version of the given [store].
[level] is the {i zlib} level compression used for Git object (between [0]