public inbox for goredo-devel@lists.stargrave.org
Atom feed
* Unexpected behavior in redoing target with missing .redo info
@ 2025-12-05 18:30 Niklas Böhm
  2025-12-05 19:26 ` goredo
  2025-12-12 15:38 ` Sergey Matveev
  0 siblings, 2 replies; 4+ messages in thread
From: Niklas Böhm @ 2025-12-05 18:30 UTC (permalink / raw)
  To: goredo-devel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-16 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-05 18:30 Unexpected behavior in redoing target with missing .redo info Niklas Böhm
2025-12-05 19:26 ` goredo
2025-12-12 15:38 ` Sergey Matveev
2025-12-16 13:45   ` Sergey Matveev