Skip to content

Conversation

@codeaucafe
Copy link

Summary

Documents the new --filter option for dolt diff added in dolthub/dolt#10030.

The --filter option allows users to filter diff output by change type:

  • added - new tables and inserted rows
  • modified - schema changes and row updates
  • renamed - renamed tables
  • dropped - dropped tables and deleted rows (removed accepted as alias)

Changes

Concept Docs (concepts/dolt/git/diff.md)

  • Added new "Filtering Diffs by Change Type" section
  • Includes use cases, CLI examples, and link to SQL-based filtering docs

CLI Reference (reference/cli/cli.md)

  • Regenerated via dolt dump-docs per contribution guidelines
  • Includes --filter option for dolt diff
  • Also picks up other pending doc updates: dolt backup, dolt gc, and dolt sql-server config options

Note on CLI Reference Changes

Given the CLI reference (cli.md) is auto-generated via dolt dump-docs, since the docs were last regenerated, other changes have been made to dolt's CLI help text. This PR includes those updates as well (backup, gc, sql-server config
options) to bring the docs in sync with the current dolt version. If this is not desired, I can make a commit removing them so that this PR is solely focused on the dolt diff --filter option added. Just let me know

Related

Document the new --filter option for dolt diff command that allows
filtering output by change type (added, modified, renamed, dropped).

Updates:
- Concept docs: added new "Filtering Diffs by Change Type" section
with use cases, examples, and link to SQL-based filtering
- CLI reference: regenerated via `dolt dump-docs` which also includes
other pending doc updates (backup, gc, sql-server config options)

Refs: dolthub/dolt#1430
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've update these with the cli dump command so you can remove these changes.

Comment on lines 42 to 45
This is particularly useful when:
- Reviewing diffs with thousands of changes across multiple tables
- Focusing on deletions that may need extra scrutiny
- Isolating schema changes from data changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is extra fluff to be honest, I would remove these extra recommendations.

Comment on lines 47 to 56
```bash
# Show only deleted rows and dropped tables
dolt diff HEAD~1 --filter=dropped

# Show only new tables and inserted rows as SQL
dolt diff HEAD~1 --filter=added -r sql

# Show only renamed tables
dolt diff HEAD~1 --filter=renamed
```
Copy link
Contributor

@elianddb elianddb Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I think these are good examples, but they are kind of covered above already. We usually build off what we've already shown. The new information you've introduced instead is that it can be used -r sql e.g. here.

Comment on lines +57 to +58

For SQL-based filtering, see the [`dolt_diff_<tablename>` system tables documentation](../../../reference/sql/version-control/dolt-system-tables.md#database-diffs), which supports filtering via `WHERE diff_type = 'added'` (or `'modified'`, `'removed'`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good information! Eventually we'll have to merge the CLI and SQL paths.

@elianddb
Copy link
Contributor

@codeaucafe A couple of comments on diff.md and clarification on cli.md.

@codeaucafe
Copy link
Author

Thanks I'll adjust accordingly

…deaucafe/1430/add-filter-option-docs

# Conflicts:
#	packages/dolt/content/reference/cli/cli.md
@codeaucafe
Copy link
Author

hey @elianddb FYI, got rid of the fluff and the cli.md changes that were auto-generated from release, so the PR is just the simple leftovers in ‎packages/dolt/content/concepts/dolt/git/diff.md‎

thank you.

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.

2 participants