123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899(*******************************************************************************)(* Volgo - a Versatile OCaml Library for Git Operations *)(* Copyright (C) 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of Volgo. *)(* *)(* Volgo is free software; you can redistribute it and/or modify it under *)(* the terms of the GNU Lesser General Public License as published by the *)(* Free Software Foundation either version 3 of the License, or any later *)(* version, with the LGPL-3.0 Linking Exception. *)(* *)(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(*******************************************************************************)open!ImportmoduleLine=struct[@@@coverageoff]typet={rev:Rev.t;ref_kind:Ref_kind.t}[@@deriving_inlinesexp_of]letsexp_of_t=(fun{rev=rev__002_;ref_kind=ref_kind__004_}->letbnds__001_=([]:_Stdlib.List.t)inletbnds__001_=letarg__005_=Ref_kind.sexp_of_tref_kind__004_in(Sexplib0.Sexp.List[Sexplib0.Sexp.Atom"ref_kind";arg__005_]::bnds__001_:_Stdlib.List.t)inletbnds__001_=letarg__003_=Rev.sexp_of_trev__002_in(Sexplib0.Sexp.List[Sexplib0.Sexp.Atom"rev";arg__003_]::bnds__001_:_Stdlib.List.t)inSexplib0.Sexp.Listbnds__001_:t->Sexplib0.Sexp.t);;[@@@deriving.end]letequal=(funa__001_b__002_->ifa__001_==b__002_thentrueelseRev.equala__001_.revb__002_.rev&&Ref_kind.equala__001_.ref_kindb__002_.ref_kind:t->t->bool);;endmoduleT=struct[@@@coverageoff]typet=Line.tlist[@@deriving_inlinesexp_of]letsexp_of_t=(funx__006_->sexp_of_listLine.sexp_of_tx__006_:t->Sexplib0.Sexp.t);;[@@@deriving.end]letequalab=equal_listLine.equalabendincludeTlettags(t:t)=List.filter_mapt~f:(function|{Line.rev=_;ref_kind=Tag{tag_name}}->Sometag_name|_->None)|>List.sort~compare:Tag_name.compare;;letlocal_branches(t:t)=List.filter_mapt~f:(function|{Line.rev=_;ref_kind=Local_branch{branch_name}}->Somebranch_name|_->None)|>List.sort~compare:Branch_name.compare;;letremote_branches(t:t)=List.filter_mapt~f:(function|{Line.rev=_;ref_kind=Remote_branch{remote_branch_name}}->Someremote_branch_name|_->None)|>List.sort~compare:Remote_branch_name.compare;;