Skip to content

Feature request: show breadcrumbs for better context information #991

Description

@svdo

Hi, thank you for difftastic, it's an awesome tool!

I wonder if you might consider adding a feature for showing breadcrumbs to difftastic. This is maybe not useful for all languages, but definitely for highly hierarchical languages like yaml and json. When I say 'breadcrumbs' I'm referring to the way it's called in vscode. It's a way of showing context, not by displaying lines before and after, but by showing where the line is in the structure of the document, i.e. which parents there are.

As an example, consider two yaml files describing a Kubernetes deployment. The diff is this:

after.yaml --- YAML
65 65           - mountPath: /secrets
66 66             name: secrets
67 67             readOnly: true
.. 68         hostUsers: false
68 69         securityContext:
69 70           fsGroup: 2004
70 71           runAsGroup: 10401
Image

Just to clarify, this is what vscode displays for breadcrumbs:

Image

Difftastic could display this by outputting the relevant lines as well as any other context. I feel it probably should be a separate command line option so that it can be used independently of the mode and context size.

Looking forward to your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions