Skip to content

borg diff should have --format option #4634

@elho

Description

@elho

The diff sub-command should have a --format option like e.g. the list sub-command has.

Placeholders should include (but not be limited to), path, type (directory entry type, same as with list), change (giving the type of change, ie. whether added, deleted, modified (content change), owner, group, mode, etc. - speaking long or like AME, whatever is deemed preferable) and whatever fields to represent what else diff has at its hands that it can output, e.g. oldsize, newsize, deltasize, etc.
If several aspects of a directory entry were changed, multiple lines, each with the according change value would be printed. This does not sound nice at first, bit fits the format-string style output (as opposed to more template style with conditionals etc.) and suits working on the output with shell tools like grep.

This would allow to do stuff like borg diff --format "{change}{type}:{path}{NUL}" | sed --null-data --quiet --expression='s/(A|M)-://p' | xargs --null dosomethingwithchangedfiles, thus being able to workaround/solve e.g. #3514 and #4191.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions