123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081(*******************************************************************************)(* 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=|Rootof{rev:Rev.t}|Commitof{rev:Rev.t;parent:Rev.t}|Mergeof{rev:Rev.t;parent1:Rev.t;parent2:Rev.t}[@@derivingsexp_of]letequal=(funa__001_b__002_->ifa__001_==b__002_thentrueelse(matcha__001_,b__002_with|Root_a__003_,Root_b__004_->Rev.equal_a__003_.rev_b__004_.rev|Root_,_->false|_,Root_->false|Commit_a__005_,Commit_b__006_->Rev.equal_a__005_.rev_b__006_.rev&&Rev.equal_a__005_.parent_b__006_.parent|Commit_,_->false|_,Commit_->false|Merge_a__007_,Merge_b__008_->Rev.equal_a__007_.rev_b__008_.rev&&Rev.equal_a__007_.parent1_b__008_.parent1&&Rev.equal_a__007_.parent2_b__008_.parent2):t->t->bool);;letrev=function|Commit{rev;_}|Merge{rev;_}|Root{rev}->rev;;endmoduleT=struct[@@@coverageoff]typet=Line.tlist[@@derivingsexp_of]letequalab=equal_listLine.equalabendincludeTletroots(t:t)=List.filter_mapt~f:(funline->match(line:Line.t)with|Root{rev}->Somerev|Commit_|Merge_->None);;