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

[PATCH 0/2] gitignore, re-inclusion fix

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Aug 23, 2015, 12:50 UTC
Message-ID
<1440334214-32131-1-git-send-email-pclouds@gmail.com>

This is an old problem. I attempted once [1] and then was reminded [2] with some more comments on the original patch. Let's try again.

The problem is this .gitignore currently does not work, but it should:

/abc !/abc/def/ghi

This patch fixes that by realizing that the last rule may re-include something in abc/def so it does not exclude "abc" and "abc/def" outright to give the last rule a chance to match.

[1] http://article.gmane.org/gmane.comp.version-control.git/259870 [2] http://thread.gmane.org/gmane.comp.version-control.git/265901/focus=266227

Nguyễn Thái Ngọc Duy (2):
  dir.c: make last_exclude_matching_from_list() run til the end
  dir.c: don't exclude whole dir prematurely if neg pattern may match
 Documentation/gitignore.txt        | 21 ++++++---
 dir.c                              | 89 +++++++++++++++++++++++++++++++++++---
 t/t3001-ls-files-others-exclude.sh | 20 +++++++++
 3 files changed, 118 insertions(+), 12 deletions(-)
-- 
2.3.0.rc1.137.g477eb31
Next: Nguyễn Thái Ngọc Duy
Message 1 of 10 in “gitignore, re-inclusion fix”
  1. 0/2 gitignore, re-inclusion fixNguyễn Thái Ngọc Duy, Aug 23, 2015
  2. 1/2 dir.c: make last_exclude_matching_from_list() run til the endNguyễn Thái Ngọc Duy, Aug 23, 2015
  3. Junio C HamanoAug 25, 2015
  4. Duy NguyenAug 31, 2015
  5. 2/2 dir.c: don't exclude whole dir prematurely if neg pattern may matchNguyễn Thái Ngọc Duy, Aug 23, 2015
  6. 0/2 gitignore, re-inclusion fixNguyễn Thái Ngọc Duy, Sep 13, 2015
  7. 1/2 dir.c: make last_exclude_matching_from_list() run til the endNguyễn Thái Ngọc Duy, Sep 13, 2015
  8. 2/2 dir.c: don't exclude whole dir prematurely if neg pattern may matchNguyễn Thái Ngọc Duy, Sep 13, 2015
  9. Junio C HamanoSep 14, 2015
  10. Duy NguyenSep 17, 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.