Subject: Unexpected behavior in redoing target with missing .redo info

From: Niklas Böhm <[email-masked]>
Date: Fri, 5 Dec 2025 19:30:26 +0100

Hi,

I observed the following problem with using redo and would like to 
challenge the current behavior of the program.

I have the following file with one line, 1.do:
echo hi > $3

When I now call `redo 1`, everything works as expected.  But in case the 
file `1` already exists (or you remove the folder `.redo/`), then the 
call to `redo 1` throws the following error:

err  1 (0.001s): $1 was explicitly touched

I think that this is a bug (most probably related to run.go l.674 or so) 
and the behavior should be to either (a) detect it as a source file and 
not redo it (the behavior if the file `1.do` did not exist) or (b) redo 
the target properly.  I strongly prefer option (a), as we should not 
mess with a file that we do not know the origin of.

At the very least, the error message about $1 being touched (which is 
not happening in this scenario) is quite misleading (I actually thought 
that I misunderstood something about this).  There might be a logic 
error with regards to when the presence of a source file if checked and 
the presence of a .do file.

Let me know what you think!  And thanks for goredo :)

Greetings
Nik