Subject: Re: [PATCH] Don't create nested target directories automatically

From: goredo <[email-masked]>
Date: Fri, 15 Apr 2022 13:17:10 +0000 (UTC)

I may have misunderstood you. I thought, you wanted redo to fail immediately, once it is called on a target in an non-existent directory. Okay, the contract, then, would be, that you'd have to create the directory before writing. Which, of course, is reasonable.

Next situation: In goredo, it is legal and wanted, that you can implement always-out-of-date targets by not creating any output. You would still need the directory to store the record for that target. And it would not be obvious, why you'd have to have a mkdir call, when you don't want to write something. Those would also pollute apenwarr user's trees, who don't have to do that.

One suggestion to your patch: Instead of failing, you could defer creating the directory to the point where redo actually wants to write a record to a file.