Skip to content

Colors in "diff -u | d-s-f" stop working with stripLeadingSymbols = false #466

@patrikndv

Description

@patrikndv

When not having any settings in the [color "diff-highlight"] section of gitconfig, the highlight still works in git commands by inverting foreground and background colors. When additionally setting stripLeadingSymbols = false, the behaviour is still correct in git commands. So far so good.

However, with stripLeadingSymbols = false the behaviour is not correct anymore when piping the output of diff -u to diff-so-fancy. Assuming diff-highlight settings are set, only lines with highlight will be colored but all other +/- lines will have no color at all. When diff-highlight settings are not set, no +/- line at all will have color (not even the lines with highlight). Expected behavior is that stripLeadingSymbols = false should not affect coloring of +/- lines, and when diff-highlight settings are not set the highlight should invert foreground and background colors like it does correctly in git commands and when stripLeadingSymbols = true.

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