From: Jonathan Nieder <jrnieder@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Elias Persson <delreich@takeit.se>
Subject: Re: [PATCH] config.txt,diff-options.txt: porcelain vs. plumbing for color.diff
Date: Wed, 27 Apr 2011 04:03:23 -0500 [thread overview]
Message-ID: <20110427090323.GA14849@elie> (raw)
In-Reply-To: <24a6907cade7aedb51dc20ab5977603ca21e70bb.1303889849.git.git@drmicha.warpmail.net>
Michael J Gruber wrote:
> Reading the diff-family and config man pages one may think that the
> color.diff and color.ui settings apply to all diff commands. Make it
> clearer that they do not apply to the plumbing variants
> diff-{files,index,tree}.
Sounds like a good idea. Quick reactions:
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -708,7 +708,7 @@ second is the background. The position of the attribute, if any,
> doesn't matter.
>
> color.diff::
> - When set to `always`, always use colors in patch.
> + When set to `always`, always use colors in patch for porcelain commands.
> When false (or `never`), never. When set to `true` or `auto`, use
> colors only when the output is to the terminal. Defaults to false.
I am not sure I like promising that all porcelain commands will use
color; for example, "git commit -v" does not (though "commit -v
--dry-run" does). Maybe:
Whether to use ANSI escape sequences to add color to patches.
If this is set to `always`, linkgit:git-diff[1],
linkgit:git-log[1], and linkgit:git-show[1] will use color
for all patches. If it is set to `true` or `auto`, those
commands will only use color when output is to the terminal.
Defaults to false.
+
This does not affect linkgit:git-format-patch[1] or the
'git-diff-{asterisk}' plumbing commands. Can be overridden on the
command line with the `--color[=<when>]` option.
> @@ -796,7 +796,7 @@ color.status.<slot>::
> color.branch.<slot>.
>
> color.ui::
> - When set to `always`, always use colors in all git commands which
> + When set to `always`, always use colors in all porcelain commands which
> are capable of colored output. When false (or `never`), never. When
Nitpick: the grammatical subject of the dependent clause ("when set to
always") and the rest of the sentence ("always use colors") differ, so
the sentence sounds awkward. Not your fault, but while we're here, it
might be nice to change that.
I think the intent is something like
This variable determines the default for color.branch,
color.diff, color.grep, color.interactive, color.showbranch,
and color.status, and its scope will expand as other commands
learn configuration to set a default for the --color option.
Set it to "always" if you want all output not intended for
machine consumption to use color, to "true" or "auto" if you
want such output to use color when written to the terminal,
or to "false" or "never" if you prefer git commands not to
use color unless enabled explicitly with some other
configuration or the --color option.
In other words, it's closer to "all appropriate commands" than "all
porcelain". format-patch is porcelain. Not sure what a concise way
to say that is, though.
Thanks, and hope that helps.
Jonathan
next prev parent reply other threads:[~2011-04-27 9:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 15:04 git diff-index ignores color config Elias Persson
2011-04-26 17:42 ` Junio C Hamano
2011-04-27 7:20 ` Elias Persson
2011-04-27 7:38 ` [PATCH] config.txt,diff-options.txt: porcelain vs. plumbing for color.diff Michael J Gruber
2011-04-27 9:03 ` Jonathan Nieder [this message]
2011-04-27 16:39 ` Junio C Hamano
2011-04-27 18:30 ` Junio C Hamano
2011-04-27 22:12 ` Jonathan Nieder
2011-04-28 7:47 ` Michael J Gruber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110427090323.GA14849@elie \
--to=jrnieder@gmail.com \
--cc=delreich@takeit.se \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).