Skip to content

feat: ability to specify "content" or "metadata" for incremental - #1493

Merged
dsherret merged 6 commits into
mainfrom
feat/incremental-modes
Nov 30, 2026
Merged

dsherret merged 6 commits into
mainfrom
feat/incremental-modes

Conversation

@dsherret

@dsherret dsherret commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

incremental now also accepts content and metadata, both in the configuration file and for --incremental=. Mostly this is for being able to turn off skipping files by their metadata (#1491) without losing the incremental cache, for example on a network drive.

Value Behavior
true Same as before: metadata on macOS when not on a CI, otherwise content
content Opens every file and compares its content
metadata Does not open the files whose metadata has not changed, and compares the content of the rest
false Same as before: disabled

The defaults don't change.

  • On Windows, metadata is opt-in because it does not notice a change made through a memory mapped file. It uses GetFileInformationByName, which does not open the file and has the change time and file id. That needs Windows 11 24H2 or Windows Server 2025. Older versions use the content, which is only logged in the debug output because the configuration file could be shared between systems. Getting the metadata any other way opens the file, and was slower than reading it on one of the drives I tried.
  • metadata is used on a CI when it's specified.
  • --incremental and --incremental=true only say to enable it, so they keep content or metadata when the configuration file has that.
  • Older versions of dprint will error on the new values, both in the configuration file and on the command line.

Warm dprint check on Windows 11 with 5,000 small files:

content metadata
NTFS 93.2ms 42.2ms
ReFS 51.1ms 41.8ms

@dsherret
dsherret merged commit 0952932 into main Nov 30, 2026
6 checks passed
@dsherret
dsherret deleted the feat/incremental-modes branch November 30, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant