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

Re: Git Ignore Exception bug

From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date
Sep 14, 2016, 11:26 UTC
Message-ID
<1473852376.30531.20.camel@kaarsemaker.net>
In-Reply-To
<CAC5iUd2mS1n1=sRB=Bs6tn3L3raAXrZaEcs765UFtQZB9XZuYg@mail.gmail.com>
On vr, 2016-09-09 at 15:39 -0600, Nathan Williams wrote:
> it ignore doesn't seem to be working properly when adding exceptions.
>8 -- snip testcase
Show 7 quoted lines
> Expected results
> % git st
> On branch master
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
> 
>         foo/bar/

That expectation is wrong, it should show foo/. And indeed it does (tested with 2.9.0 and 2.10.0-rc1)

$ sh -x testscript
+ rm -rf repo
+ mkdir repo
+ cd repo
+ git init
Initialized empty Git repository in /home/dennis/code/git/repo/.git/
+ echo foo/*
+ echo !foo/bar
+ git add .gitignore
+ git commit -m Ignore file with exceptions
[master (root-commit) 7e1b82a] Ignore file with exceptions
 1 file changed, 2 insertions(+)
 create mode 100644 .gitignore
+ mkdir foo
+ mkdir foo/bar
+ touch foo/1
+ touch foo/2
+ touch foo/bar/a
+ touch foo/bar/b
+ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	foo/
nothing added to commit but untracked files present (use "git add" to track)
-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net
Previous: Nathan Williams
Message 2 of 2 in “Git Ignore Exception bug”
  1. Nathan WilliamsSep 9, 2016
  2. Dennis KaarsemakerSep 14, 2016

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.