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

Re:

From
Jeff King <peff@peff.net>
Date
Mar 18, 2015, 21:28 UTC
Message-ID
<20150318212852.GA28860@peff.net>
In-Reply-To
<20150318211716.GC3376@peff.net>
On Wed, Mar 18, 2015 at 05:17:16PM -0400, Jeff King wrote:
Show 8 quoted lines
> [1] The double-CR fix works because we strip a single CR from the end of
>     the line (as a convenience for CRLF systems), and then the remaining
>     CR is syntactically significant. But I am surprised that quoting
>     like:
> 
>       printf '"Icon\r"' >.gitignore
> 
>     does not seem to work.

Answering myself: we don't do quoting like this in .gitignore. We allow backslashing to escape particular characters, like trailing whitespace. So in theory:

  Icon\\r

(where "\r" is a literal CR) would work. But it doesn't, because the CRLF chomping happens separately, and CR is therefore a special case. I suspect you could not .gitignore a file with a literal LF in it at all (and I equally suspect that nobody cares in practice).

-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 4 of 6 in “Re:”
  1. Junio C HamanoMar 18, 2015
  2. Stefan BellerMar 18, 2015
  3. Jeff KingMar 18, 2015
  4. Jeff KingMar 18, 2015
  5. Junio C HamanoMar 18, 2015
  6. Stefan BellerMar 18, 2015

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.