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

Re: End-of-line comments are prompted with "is not a valid attribute name"

From
DD无数 <wushuripple@gmail.com>
Date
Dec 17, 2023, 17:28 UTC
Message-ID
<CAOQ=bxyBVRJN68iLs7g=DjB+J7aHEFgwnGuhS_ub2=q3StiRkQ@mail.gmail.com>
In-Reply-To
<xmqqo7eoiwcb.fsf@gitster.g>

I see, thanks for the answer. I was fooled by the VSCode highlighting, but also because I didn't try to figure out the documentation carefully.

Junio C Hamano <gitster@pobox.com> 于2023年12月18日周一 01:15写道:
Show 25 quoted lines
>
> Junio C Hamano <gitster@pobox.com> writes:
>
> > This is totally expected; nothing to see here.
>
> To put it another way, we do not have "end-of-line comment"
> (i.e. the leading part of a line has payload, but the line is
> chomped in the middle with a comment character and the remainder of
> the line is ignored) at all.  We have "commented line" (in other
> words, a line that is totally commented out and gets ignored).
>
> I think it is very clearly documented in "git help attributes":
>
>     A `gitattributes` file is a simple text file that gives
>     `attributes` to pathnames.
>
>     Each line in `gitattributes` file is of form:
>
>             pattern attr1 attr2 ...
>
>     That is, a pattern followed by an attributes list,
>     separated by whitespaces. Leading and trailing whitespaces are
>     ignored. Lines that begin with '#' are ignored. Patterns
>     that begin with a double quote are quoted in C style.
>
Previous: Junio C Hamano
Message 4 of 4 in “End-of-line comments are prompted with "is not a valid attribute name"”
  1. D无数Dec 13, 2023
  2. Junio C HamanoDec 13, 2023
  3. Junio C HamanoDec 17, 2023
  4. D无数Dec 17, 2023

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.