From d5596eb1a34ce7455bfb5edc70f3f868957c6497 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 25 Aug 2020 16:24:36 -0700 Subject: [PATCH 1/2] clay: if commit would be a no-op, don't commit it fixes #3317 --- pkg/arvo/sys/vane/clay.hoon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 14d23c8d4..8a9f96224 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1365,6 +1365,7 @@ |^ |= [updated=? =yoki =rang] ^+ ..park + =/ abort ..park =: hut.ran (~(uni by hut.rang) hut.ran) lat.ran (~(uni by lat.rang) lat.ran) == @@ -1428,6 +1429,10 @@ %| p.value %& lobe:(~(got by change-cages) path) == + :: if we didn't change the data and it's not a merge commit, abort + :: + ?: &(?=([@ ~] p.p.yoki) =(data old-lobes)) + abort =/ =yaki ?- -.yoki %& (make-yaki p.p.yoki data now) From f606d2e3d62ab7d630adfcbc09b94f7a337aa17b Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 25 Aug 2020 18:00:31 -0700 Subject: [PATCH 2/2] clay: cleaner no-op detection Only no-op if the incoming commit's parent is the old head of the desk. Also move the printing near the end so we can know exactly if anything changed. --- pkg/arvo/sys/vane/clay.hoon | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 8a9f96224..a9be2fb46 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1365,7 +1365,6 @@ |^ |= [updated=? =yoki =rang] ^+ ..park - =/ abort ..park =: hut.ran (~(uni by hut.rang) hut.ran) lat.ran (~(uni by lat.rang) lat.ran) == @@ -1374,12 +1373,12 @@ %& q.p.yoki %| (~(run by q.p.yoki) |=(=lobe |+lobe)) == - =/ old-lobes=(map path lobe) + =/ old-yaki ?: =(0 let.dom) - ~ - q:(aeon-to-yaki:ze let.dom) + *yaki + (aeon-to-yaki:ze let.dom) =/ [deletes=(set path) changes=(map path (each page lobe))] - (get-changes old-lobes new-data) + (get-changes q.old-yaki new-data) ~| [from=let.dom deletes=deletes changes=~(key by changes)] :: :: promote ford cache @@ -1392,13 +1391,6 @@ |(!=(~ sys-changes) !=(~ (need-vane-update changes))) == (sys-update yoki new-data changes) - =. ..park - %- emil - =/ changed=(set path) ~(key by changes) - =/ existed=(set path) ~(key by old-lobes) - %^ print deletes - (~(int in changed) existed) - (~(dif in changed) existed) :: clear caches if zuse reloaded :: =/ is-zuse-new=? !=(~ sys-changes) @@ -1409,7 +1401,7 @@ =. fer.dom `(build-reef fer.dom ~(key by changes) new-data) =? ank.dom is-zuse-new *ankh =? changes is-zuse-new - (changes-for-upgrade old-lobes deletes changes) + (changes-for-upgrade q.old-yaki deletes changes) :: =/ =args:ford:fusion [zuse:(need fer.dom) ank.dom deletes changes lat.ran fod.dom] @@ -1431,8 +1423,10 @@ == :: if we didn't change the data and it's not a merge commit, abort :: - ?: &(?=([@ ~] p.p.yoki) =(data old-lobes)) - abort + :: very important to keep all permanent changes below this point + :: + ?: &(=([r.old-yaki ~] p.p.yoki) =(data q.old-yaki)) + ..park =/ =yaki ?- -.yoki %& (make-yaki p.p.yoki data now) @@ -1455,6 +1449,7 @@ (checkout-mime args deletes ~(key by changes)) =. mim.dom (apply-changes-to-mim mim.dom mim) =. fod.dom ford-cache.args + =. ..park (emil (print q.old-yaki data)) :: wake:(ergo mim) :: @@ -1744,8 +1739,14 @@ :: Print notification to console :: ++ print - |= [deletes=(set path) changes=(set path) additions=(set path)] + |= [old=(map path lobe) new=(map path lobe)] ^- (list move) + =/ [deletes=(set path) upserts=(map path (each page lobe))] + (get-changes old (~(run by new) |=(=lobe |+lobe))) + =/ upsert-set ~(key by upserts) + =/ old-set ~(key by old) + =/ changes=(set path) (~(int in upsert-set) old-set) + =/ additions=(set path) (~(dif in upsert-set) old-set) ?~ hun ~ ?: =(0 let.dom)