Subject: Re: [bug-diffutils] bug#20062: bug#20062: bug#20062: bug#20062: bug#20062: bug#20062: bug#20062: [PATCH] diff: add support for --color

From: Giuseppe Scrivano <[email-masked]>
Date: Wed, 28 Oct 2015 16:29:06 +0100

Aaron Davies <[email-masked]> writes:

> I'm very new here, so feel free to take my opinions with a grain of salt, but one thing I've been noticing in my scripting work is that environment variables' biggest drawback is often also their big advantage: you don't have to propagate them manually.
>
> Suppose you want to encapsulate some common diff operation in a small shell script. Then anything you want that diff to do that you specified in an alias or function in your interactive shell has to be written out again.
>
> Alternatively, you could have a diff wrapper in your ~/bin setting the option, but it's hard to actually write those correctly to handle things like stdin vs. file args.
>
> None of this comes with env vars.
>
> Still, I understand your other concerns.
>
> Maybe a ~/.diffrc is the solution?

that could be a good solution, and probably other kind of options can be
moved but IMHO it seems a bit over-engineered to read just the colors
settings.

If the choice is between an env variable or adding a new command line
argument, the former makes more sense as it works similarly to other
tools that people already know.

If there is any strong argument against not using an environment
variable as this patch is doing, I will rework the patch to use a
command line argument instead.

Regards,
Giuseppe