Web lists-archives.com

Re: [PATCH v3] range-diff: always pass at least minimal diff options




On Mon, 3 Dec 2018 at 22:21, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> [es: retain diff coloring when going to stdout]
>
> Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx>
> Signed-off-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>
> ---
>
> This is a re-roll of Martin's v2[1]. The only difference from v2 is that
> it retains coloring when emitting to the terminal (plus an in-code
> comment was simplified).

Thank you so much for this.

>         if (rev->rdiff1) {
> +               /*
> +                * Pass minimum required diff-options to range-diff; others
> +                * can be added later if deemed desirable.
> +                */

Agreed.

> +               struct diff_options opts;
> +               diff_setup(&opts);
> +               opts.file = rev->diffopt.file;
> +               opts.use_color = rev->diffopt.use_color;

Ah, s/0/rev->diffopt.use_color/, well that's obvious.

Thanks!

Martin