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

Re: Bug in .gitignore handling

From
TTTommy Thorn <tommy-git@thorn.ws>
Date
Mar 26, 2008, 20:26 UTC
Message-ID
<47EAB187.4070009@thorn.ws>
In-Reply-To
<7vhcetck5m.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> Are you talking about d6b8fc3 (gitignore(5): Allow "foo/" in ignore list
> to match directory "foo", 2008-01-31), specifically this part of the
> manual?
>   
Yes, thanks.
Show 6 quoted lines
> "git clean" has always been an ugly and unreliable stepchild, and I would
> not be surprised at all if it is ridden with corner case bugs, especially
> around the area to skip untracked directories; but in this case you are
> not dealing with a directory but a symlink, and it should not get confused
> by the fact that the symlink happens to point at a directory.
>   

Thanks, but first step is in ensuring that my understanding is correct. Here's the gist of the test case:

mkdir mydir cd mydir git init mkdir mousetrap touch mousetrap/nonempty git add mousetrap/nonempty git commit -m "initial" ln -s ../otherdir/foo . echo "foo/" > .gitignore echo ".gitignore" >> .gitignore git clean -n -f -d

I expect the last command to report "Would remove mousetrap/foo/", but I currently get "Would remove foo".

Thanks, Tommy

Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 7 in “Bug in .gitignore handling”
  1. Tommy ThornMar 26, 2008
  2. Junio C HamanoMar 26, 2008
  3. Tommy ThornMar 26, 2008
  4. Linus TorvaldsMar 26, 2008
  5. Linus TorvaldsMar 26, 2008
  6. Tommy ThornMar 26, 2008
  7. Junio C HamanoMar 26, 2008

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.