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

[1.8.0] Support quoting in .gitattributes, .gitignore

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Feb 3, 2011, 11:51 UTC
Message-ID
<AANLkTikHNKmcapVWBAcufq8ONVWOWHbnL-H8Nf2WmKM5@mail.gmail.com>
Proposal:
There's already a patch for .gitattributes [1].

To summarize: .gitattributes separates pattern and attributes by spaces, therefore spaces could not be present in patterns. There are tricks to overcome (e.g. substitute spaces with dots) but it's well.. tricky. The patch adds support for quoting full patterns.

While .gitignore does not have the same problem, it'd be nice to support quoting too for a few reasons:

 - Keep differences between gitattr and gitignore to minimum. A
hero(ine) might come and unify them some day. Don't make his/her work
harder.
 - Is ability to put \n in patterns counted as a good point?
Risks:

Current patterns with leading double quote mark will be misinterpreted. Though chances are really small.

Migration plan:
I think a release note mentioning this is enough. No migration needed.

But to be safe, we can make post-1.7.5 warn users about patterns with leading double quote. By 1.8.0, the new behavior will be used.

[1] http://article.gmane.org/gmane.comp.version-control.git/160867
-- 
Duy
Next: Junio C Hamano
Message 1 of 3 in “[1.8.0] Support quoting in .gitattributes, .gitignore”
  1. Nguyen Thai Ngoc DuyFeb 3, 2011
  2. Junio C HamanoFeb 3, 2011
  3. Nguyen Thai Ngoc DuyFeb 4, 2011

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.