-
Notifications
You must be signed in to change notification settings - Fork 23
dolthub/dolt#1430: add dolt diff --filter option documentation #2736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gitbook-dev
Are you sure you want to change the base?
dolthub/dolt#1430: add dolt diff --filter option documentation #2736
Conversation
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
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
| ```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 | ||
| ``` |
There was a problem hiding this comment.
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.
|
|
||
| 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'`). |
There was a problem hiding this comment.
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.
|
@codeaucafe A couple of comments on |
|
Thanks I'll adjust accordingly |
Refs: dolthub/dolt#1430s
…deaucafe/1430/add-filter-option-docs # Conflicts: # packages/dolt/content/reference/cli/cli.md
|
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. |
Summary
Documents the new
--filteroption fordolt diffadded in dolthub/dolt#10030.The
--filteroption allows users to filter diff output by change type:added- new tables and inserted rowsmodified- schema changes and row updatesrenamed- renamed tablesdropped- dropped tables and deleted rows (removedaccepted as alias)Changes
Concept Docs (
concepts/dolt/git/diff.md)CLI Reference (
reference/cli/cli.md)dolt dump-docsper contribution guidelines--filteroption fordolt diffdolt backup,dolt gc, anddolt sql-serverconfig optionsNote on CLI Reference Changes
Given the CLI reference (
cli.md) is auto-generated viadolt 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 configoptions) 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--filteroption added. Just let me knowRelated
--filteroption for dolt diff dolt#10030 - PR adding the--filteroptiondolt diffshould support--filteroption dolt#1430 - Original issue requesting this feature