watchfiles icon indicating copy to clipboard operation
watchfiles copied to clipboard

Support `compare_contents`

Open samuelcolvin opened this issue 2 years ago • 4 comments

See here, might be good to give this option in a future release, I'm sure someone will want it.

    /// Optional feature that will evaluate the contents of changed files to determine if
    /// they have indeed changed using a fast hashing algorithm.  This is especially important
    /// for pseudo filesystems like those on Linux under /sys and /proc which are not obligated
    /// to respect any other filesystem norms such as modification timestamps, file sizes, etc.
    /// By enabling this feature, performance will be significantly impacted as all files will
    /// need to be read and hashed at each `poll_interval`.
    pub compare_contents: bool,

samuelcolvin avatar May 17 '22 16:05 samuelcolvin

I want it!

I'm using watchfires as the basis for an SSG proof of concept (namely, re-imagining Sphinx.) I need incremental builds. So I need a way to compare the current tree to the last tree. I suspect though this is beyond the scope of just the hash.

pauleveritt avatar Jun 13 '22 14:06 pauleveritt

PR welcome! Otherwise I'll get to it when I get to it.

samuelcolvin avatar Jun 13 '22 15:06 samuelcolvin

Although this will only have an effect when in force polling mode, so many better to implement it yourself.

samuelcolvin avatar Jun 13 '22 15:06 samuelcolvin

Agreed, it kind of felt like something beyond what you're looking to do.

pauleveritt avatar Jun 13 '22 15:06 pauleveritt

I think beyond the remit of watchfiles.

samuelcolvin avatar Sep 11 '22 14:09 samuelcolvin