From: "Christoph Buchner" <bilderbuchi@phononoia.at>
To: git@vger.kernel.org
Subject: Bug: git ls-files and ignored directories
Date: Wed, 30 May 2012 12:22:18 +0200 (CEST) [thread overview]
Message-ID: <20120530102218.0625CFC006A@dd24126.kasserver.com> (raw)
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
next reply other threads:[~2012-05-30 10:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 10:22 Christoph Buchner [this message]
2012-05-31 10:14 ` Bug: git ls-files and ignored directories Christoph Buchner
2012-06-01 9:37 ` Jeff King
2012-06-01 15:30 ` Clemens Buchacher
2012-06-01 16:03 ` Junio C Hamano
2012-06-01 18:28 ` Junio C Hamano
2012-06-01 19:22 ` Junio C Hamano
2012-06-02 10:33 ` Nguyen Thai Ngoc Duy
2012-06-02 11:00 ` Christoph Buchner
2012-06-02 22:56 ` Junio C Hamano
2012-06-03 11:44 ` Christoph Buchner
2012-06-03 22:24 ` Junio C Hamano
2012-06-04 2:12 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120530102218.0625CFC006A@dd24126.kasserver.com \
--to=bilderbuchi@phononoia.at \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).