From be2580be0172a29843ed64e01216da1c0ed9e935 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 5 Feb 2020 15:47:11 +0100 Subject: [PATCH] Warn when we commit a new revision --- src/libexpr/flake/flake.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc index 055ff6321..6b98cfad2 100644 --- a/src/libexpr/flake/flake.cc +++ b/src/libexpr/flake/flake.cc @@ -599,6 +599,11 @@ LockedFlake lockFlake( FlakeCache dummyCache; flake = getFlake(state, topRef, {}, lockFlags.useRegistries, dummyCache); + if (lockFlags.commitLockFile && + flake.lockedRef.input->getRev() && + prevLockedRef.input->getRev() != flake.lockedRef.input->getRev()) + warn("committed new revision '%s'", flake.lockedRef.input->getRev()->gitRev()); + /* Make sure that we picked up the change, i.e. the tree should usually be dirty now. Corner case: we could have reverted from a