Subject: Potentially unnecessary redoing of targets

From: Niklas Böhm <[email-masked]>
Date: Mon, 12 Jan 2026 10:02:04 +0100

Hello,

I noticed that there is some behavior with ood detection that can lead 
to unnecessary redoing of a target.

If you have the two simple files:

1.do:
echo 1

2.do:
redo-ifchange 1
sleep 3
echo 2

then calling `redo-ifchange 2` will run them, as intended.  When adding 
a comment to 1.do and again calling `redo-ifchange 2`, it will correctly 
redo the file `1` and afterwards redo itself.  This is kind of the 
crucial point.  If you Ctrl-C the redoing process while it's sleeping 
during execution of `2.do`, then it will (correctly, in my opinion) not 
redo the file `2` in a subsequent call to `redo-ifchange 2` since all of 
the dependencies are unchanged.

To me, this behavior could also be extended to be performed during 
execution of redo itself.  In this example, this would mean to check, 
again, if the dependencies have differing output before then starting 
the process of redoing `2`.

I acknowledge that this is not a trivial change in itself, though the 
additional computation time should be negligible, as the hash of `1` is 
already computed.  It would mean to change the ood detection to not 
declare `2` ood only based on `1.do` differing, but instead to check 
this after redoing `1`.

Let me know what you think about this proposed change!

Greetings
Nik