threads / patch / 46246

patchdoc: clarify syntax for %C(auto,...) in pretty formats

Subject: [PATCH] doc: clarify syntax for %C(auto,...) in pretty formats

## tl;dr

2 messages between Jun 24, 2017 and Jun 24, 2017. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Andreas Heiduk· Jun 24, 2017, 07:22 UTC · lore
The change actually adds only 
	(e.g. `%C(auto,red)`)
but reflowing the paragraph blows it up a little.

-------- 8< -------- The manual correctly describes the syntax with `auto,` but the trailing `,` is hard to spot in a terminal. The HTML format does not have this problem. Adding an example helps both worlds.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
---
 Documentation/pretty-formats.txt | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Show changes to Documentation/pretty-formats.txt +6 −5
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 38040e95b..b03985101 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -174,11 +174,12 @@ endif::git-rev-list[]
 - '%Creset': reset color
 - '%C(...)': color specification, as described under Values in the
   "CONFIGURATION FILE" section of linkgit:git-config[1];
-  adding `auto,` at the beginning will emit color only when colors are
-  enabled for log output (by `color.diff`, `color.ui`, or `--color`, and
-  respecting the `auto` settings of the former if we are going to a
-  terminal). `auto` alone (i.e. `%C(auto)`) will turn on auto coloring
-  on the next placeholders until the color is switched again.
+  adding `auto,` at the beginning (e.g. `%C(auto,red)`) will emit
+  color only when colors are enabled for log output (by `color.diff`,
+  `color.ui`, or `--color`, and respecting the `auto` settings of the
+  former if we are going to a terminal). `auto` alone (i.e.
+  `%C(auto)`) will turn on auto coloring on the next placeholders
+  until the color is switched again.
 - '%m': left (`<`), right (`>`) or boundary (`-`) mark
 - '%n': newline
 - '%%': a raw '%'
-- 
2.13.1
Junio C Hamano· Jun 24, 2017, 18:23 UTC · re: Andreas Heiduk · lore

Re: [PATCH] doc: clarify syntax for %C(auto,...) in pretty formats

Andreas Heiduk <asheiduk@gmail.com> writes:
Show 5 quoted lines
> The change actually adds only 
>
> 	(e.g. `%C(auto,red)`)
>
> but reflowing the paragraph blows it up a little.

In such a case, you can avoid re-flowing and make the resulting lines of a-bit uneven lengths.

The end result can be checked with "git diff --word-diff", so do not worry too much about this either way, as long as the real change is small.

Thanks.
Show 33 quoted lines
>
> -------- 8< --------
> The manual correctly describes the syntax with `auto,` but the
> trailing `,` is hard to spot in a terminal.  The HTML format does not
> have this problem.  Adding an example helps both worlds.
>
> Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
> ---
>  Documentation/pretty-formats.txt | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
> index 38040e95b..b03985101 100644
> --- a/Documentation/pretty-formats.txt
> +++ b/Documentation/pretty-formats.txt
> @@ -174,11 +174,12 @@ endif::git-rev-list[]
>  - '%Creset': reset color
>  - '%C(...)': color specification, as described under Values in the
>    "CONFIGURATION FILE" section of linkgit:git-config[1];
> -  adding `auto,` at the beginning will emit color only when colors are
> -  enabled for log output (by `color.diff`, `color.ui`, or `--color`, and
> -  respecting the `auto` settings of the former if we are going to a
> -  terminal). `auto` alone (i.e. `%C(auto)`) will turn on auto coloring
> -  on the next placeholders until the color is switched again.
> +  adding `auto,` at the beginning (e.g. `%C(auto,red)`) will emit
> +  color only when colors are enabled for log output (by `color.diff`,
> +  `color.ui`, or `--color`, and respecting the `auto` settings of the
> +  former if we are going to a terminal). `auto` alone (i.e.
> +  `%C(auto)`) will turn on auto coloring on the next placeholders
> +  until the color is switched again.
>  - '%m': left (`<`), right (`>`) or boundary (`-`) mark
>  - '%n': newline
>  - '%%': a raw '%'

← back to recent threads