All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Roland Schulz <roland@utk.edu>
Cc: git@vger.kernel.org
Subject: Re: ls-files -i & directories
Date: Fri, 31 May 2013 22:20:22 +0100	[thread overview]
Message-ID: <20130531212022.GD1072@serenity.lan> (raw)
In-Reply-To: <CAO2Twbk5cvEa2uNKMg+n4DFokJ607yRDF0dUeBJkUOAY6BAD2A@mail.gmail.com>

On Fri, May 31, 2013 at 04:22:37PM -0400, Roland Schulz wrote:
> Hi,
> 
> the gitignore rules work so that if a directory is ignored, all files
> in that directory are ignored. While that behavior isn't clearly
> documented in gitignore, this behavior is consistent across all git
> tools (status, ls-files, ...).
> 
> An exception is that listing the ignored files using "ls-files -i"
> doesn't behave the same way.
> 
> example:
> $ mkdir d
> $ touch d/f
> $ echo /d/ > .gitignore
> $ git ls-files -o --exclude-standard
> .gitignore #d/f is correctly not listed
> $ git ls-files -i --exclude-standard
> #no output
> 
> d/f isn't listed even though it is treated as an ignored file by all
> other git tools. That seems inconsistent to me. Is that behavior
> intentionally or is this a bug?

It is listed with "git ls-files -i -o --exclude-standard".  The
documentation says:

   Show only ignored files in the output. When showing files in the
   index, print only those matched by an exclude pattern.  When showing
   "other" files, show only those matched by an exclude pattern.

If you do this then it is shown:

$ git add -f d/f
$ git ls-files -i --exclude-standard
d/f

I think this is working as documented.

      reply	other threads:[~2013-05-31 21:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 20:22 ls-files -i & directories Roland Schulz
2013-05-31 21:20 ` John Keeping [this message]

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=20130531212022.GD1072@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=roland@utk.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.