difftastic icon indicating copy to clipboard operation
difftastic copied to clipboard

Parsable output

Open gerhardol opened this issue 1 year ago • 0 comments

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 https://github.com/gitextensions/gitextensions/issues/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.

gerhardol avatar Apr 01 '24 22:04 gerhardol