git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: unclear docs

From
Torsten Bögershausen <tboegi@web.de>
Date
Jan 29, 2019, 07:38 UTC
Message-ID
<20190129073810.23op5qaibyj2amwq@tb-raspi4>
In-Reply-To
<20190128183117.GA13165@sigill.intra.peff.net>
On Mon, Jan 28, 2019 at 01:31:17PM -0500, Jeff King wrote:
Show 9 quoted lines
> On Mon, Jan 28, 2019 at 09:12:00PM +0300, Sergey Lukashev wrote:
>
> > Thank you. Does the paragraph about core.eol refers to the text
> > attribute? It's written 'property' there. I was thinking it means
> > whether git thinks file is text, using .gitattributes OR otherwise.
> > Maybe changing this word will make it clearer?
>
> Yeah, I think the word "property" is unnecessarily confusing. Here's
> another patch (meant to go on top of the other).
The property was originally meant to say:
- Either the "text" attribute is set in .gitattributes
  or
- The "text=auto" attribute is set in .gitattributes and
  Git auto-detects the file as text (and not as binary).
Show 35 quoted lines
>
> -- >8 --
> Subject: [PATCH] docs/config: clarify "text property" in core.eol
>
> The word "property" is less clear than "attribute", which is used
> elsewhere in the (surprise!) gitattributes documentation. So let's use
> that.
>
> While we're here, let's make the paragraph a little easier to read by
> de-emphasizing the "when core.autocrlf is false" bit. Putting it in the
> first sentence obscures the main content, and many readers won't care
> about autocrlf (i.e., anyone who is just following the gitattributes(7)
> advice, which mainly discusses "text" and "core.eol").
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  Documentation/config/core.txt | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt
> index d0e6635fe0..69c73ffe30 100644
> --- a/Documentation/config/core.txt
> +++ b/Documentation/config/core.txt
> @@ -121,11 +121,12 @@ core.quotePath::
>
>  core.eol::
>  	Sets the line ending type to use in the working directory for
> -	files that have the `text` property set when core.autocrlf is false.
> +	files that have the `text` attribute.
>  	Alternatives are 'lf', 'crlf' and 'native', which uses the platform's
>  	native line ending.  The default value is `native`.  See
>  	linkgit:gitattributes[5] for more information on end-of-line
> -	conversion.
> +	conversion. Note that this value is ignored if `core.autocrlf`
> +	is set to `true`.
Should that be
 > +	conversion. Note that this value is ignored if `core.autocrlf`
 > +	is set to `true` or `input`.
As we look at convert.c:
static int text_eol_is_crlf(void)
{
  if (auto_crlf == AUTO_CRLF_TRUE)
    return 1;
  else if (auto_crlf == AUTO_CRLF_INPUT)
    return 0;
  if (core_eol == EOL_CRLF)
    return 1;
  if (core_eol == EOL_UNSET && EOL_NATIVE == EOL_CRLF)
    return 1;
  return 0;
}
Previous: Jeff KingNext: Sergey Lukashev
Message 6 of 16 in “unclear docs”
  1. Sergey LukashevJan 27, 2019
  2. Sergey LukashevJan 27, 2019
  3. Jeff KingJan 28, 2019
  4. Sergey LukashevJan 28, 2019
  5. Jeff KingJan 28, 2019
  6. Torsten BögershausenJan 29, 2019
  7. Sergey LukashevJan 29, 2019
  8. 0/2 eol/autocrlf doc clarificationsJeff King, Jan 29, 2019
  9. 1/2 doc/gitattributes: clarify "autocrlf overrides eol"Jeff King, Jan 29, 2019
  10. 2/2 docs/config: clarify "text property" in core.eolJeff King, Jan 29, 2019
  11. Torsten BögershausenJan 28, 2019
  12. Jeff KingJan 28, 2019
  13. Junio C HamanoJan 28, 2019
  14. Jeff KingJan 28, 2019
  15. Sergey LukashevJan 28, 2019
  16. Jeff KingJan 28, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.