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

Bug: git ls-files and ignored directories

From
CBChristoph Buchner <bilderbuchi@phononoia.at>
Date
May 31, 2012, 10:14 UTC
Message-ID
<20120531101451.C35C5B4C00D@dd24126.kasserver.com>
In-Reply-To
<20120530102218.0625CFC006A@dd24126.kasserver.com>

This is the right place to report bugs, right? Is there any protocol to follow I'm not aware of, to enable you to process this bug report?

greets, Christoph

----- Original Message -----
From: bilderbuchi@phononoia.at
To: git@vger.kernel.org
Date: 30.05.2012 12:22:18
Subject: Bug: git ls-files and ignored directories
Show 28 quoted lines
> Hi!
> 
> I think I've been bitten by a bug in git ls-files - committed directories (and files therein) which are matched by a "dir/" gitignore rule are not shown by "git ls-files --exclude-standard -i", although they should be. Matched files are shown.
> 
> I've found a very brief discussion on this mailing list from March 2011 about this, including a repro procedure which still is valid today, at http://marc.info/?l=git&m=129926031808376&w=4
> 
> Is that a known/in progress bug? If yes, (when) can a fix be expected? How can I work around this in the meantime? 
> If it's not a bug, how do you do this properly? My original problem was that  I want to list files which have been committed to git but match an existing gitignore pattern. Richard Hansen has written a very nice alias for that (http://stackoverflow.com/a/9370094/599884, with some discussion of this bug in the comments), but due to the present bug this does not work totally correctly. 
> 
> Having a built-in git feature for this would be great, btw ("git ls-files --committed-but-ignored"? :-)). Do I have to submit a separate feature request?
> 
> thanks, 
> Christoph
> 
> p.s.: The repro procedure from the linked list discussion:
>> $ mkdir test
>> $ cd test
>> $ git init
>> $ mkdir testdir
>> $ touch testdir/test
>> $ git add testdir/test
>> $ git commit -m "add test"
>> $ echo "testdir/" > .gitignore
>> $ git ls-files --exclude-standard -i
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Christoph BuchnerNext: Jeff King
Message 2 of 13 in “Bug: git ls-files and ignored directories”
  1. Christoph BuchnerMay 30, 2012
  2. Christoph BuchnerMay 31, 2012
  3. Jeff KingJun 1, 2012
  4. Clemens BuchacherJun 1, 2012
  5. Junio C HamanoJun 1, 2012
  6. Junio C HamanoJun 1, 2012
  7. Junio C HamanoJun 1, 2012
  8. Nguyen Thai Ngoc DuyJun 2, 2012
  9. Christoph BuchnerJun 2, 2012
  10. Junio C HamanoJun 2, 2012
  11. Christoph BuchnerJun 3, 2012
  12. Junio C HamanoJun 3, 2012
  13. Junio C HamanoJun 4, 2012

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.