From: Joey Hess Date: Wed, 26 Jul 2023 19:28:57 +0000 (-0400) Subject: improve match result display simplifier X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~36^2~40 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=08071a1b90060c93acf07f79535ee92d3bf24168;p=git-annex.git improve match result display simplifier Sponsored-by: Dartmouth College's DANDI project --- diff --git a/Utility/Matcher.hs b/Utility/Matcher.hs index 23dec0c22f..e252eae538 100644 --- a/Utility/Matcher.hs +++ b/Utility/Matcher.hs @@ -242,6 +242,12 @@ describeMatchResult descop l prefix = Just $ -- (foo and bar) and baz => foo and bar and baz simplify _ (MatchedOpen:o1@(MatchedOperation {}):MatchedAnd:o2@(MatchedOperation {}):MatchedClose:MatchedAnd:rest) = o1:MatchedAnd:o2:MatchedAnd:simplify False rest + -- or (foo) => or foo + simplify _ (MatchedOr:MatchedOpen:o@(MatchedOperation {}):MatchedClose:rest) = + MatchedOr:o:simplify False rest + -- and (foo) => and foo + simplify _ (MatchedAnd:MatchedOpen:o@(MatchedOperation {}):MatchedClose:rest) = + MatchedAnd:o:simplify False rest -- (not foo) => not foo simplify _ (MatchedOpen:MatchedNot:o@(MatchedOperation {}):MatchedClose:rest) = MatchedNot:o:simplify False rest