Skip to content
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

Parsable output #691

Open
gerhardol opened this issue Apr 1, 2024 · 0 comments
Open

Parsable output #691

gerhardol opened this issue Apr 1, 2024 · 0 comments

Comments

@gerhardol
Copy link

Difftastic could be used to show an alternative view of differences also in other tools.
The "unstable" json output could maybe be used, but then you get no context information and have to be reconstructed. (I find the output having incomplete contents too, but have not investigated.)

I am considering adding Difftastic to https://github.com/gitextensions/gitextensions, discussed in gitextensions/gitextensions#11618
Support that is reasonable is to parse the line numbers with the type of change. It is a little too much guessing right now, it would be nice if this was easier to parse.

Suggestion:

        .arg(
            Arg::new("porcelain").long("porcelain")
                .possible_values(["0", "1"])
                .default_value("0")
                .env("DFT_PORCELAIN")
                .value_name("WHEN")
                .help("Use porcelain output, partly parseble.")
        )

First two characters define the type of information
Letters could be used instead to simplify regex

h: header third char starts second column size followed by single space, 0 if only one column (this should be inserted for each new file)
space: No info, like line after header or no info in second column
. (period): No status change, context
+: Added info
-: Removed
c: continued line

The second char will always be space unless there are two columns
An alternative would be one character and have "second column" on the second line with another marker.

Other:

  • Any suggest icon for Difftastic? Can favicon be used?
  • Any plans for color theming other than light/dark? Use Git config colors would be my preference.
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

No branches or pull requests

1 participant