Skip to content

jabkit: a --dry-run that prints what a cleanup would change #765

Description

@calixtus

🤖 A cleanup, a formatter batch or an import in jabkit writes the library and tells the user how many entries it touched. It cannot say what it would change without changing it.

The machinery for that already exists and needs no undo journal at all:

  • Every operation that edits entries returns FieldChanges, and the undo model turns those into BibChange records that describe a modification as a value.
  • org.jabref.logic.undo.BibChangeDescriber already renders such a change as text the user reads — it is what the GUI's undo notification says ("Change field Author").

So a --dry-run flag would run the operation against the library, collect the changes, print them, and not save. The one design question is output: one line per change, or grouped per entry, and whether --dry-run belongs on each subcommand or as a global flag.

Context: the undo/redo workstream moved the change model from org.jabref.gui.undo into jablib precisely so that jabkit and jabsrv are not shut out of it. Nothing uses it outside the GUI yet; this is the smallest thing that would.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions