git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Carmen Bianca Bakker <carmenbianca@fsfe.org>
To: git@vger.kernel.org
Subject: Bug report: `git-ls-files --exclude-standard --ignored --others --directory` gives incomplete output
Date: Thu, 18 Apr 2019 08:49:56 +0200	[thread overview]
Message-ID: <f5a8939f2efddb194dadb59c946522a75c5bda53.camel@fsfe.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

Hi git developers,

Apologies in advance if my mailing list etiquette isn't 100% perfect. I
don't use mailing lists all that often. Please CC me in replies, because
I am not subscribed.

I use `git-ls-files` in a project[1] to get a list of ignored
files/directories, and to ignore them in my project.  I found that using
`--directory` speeds things up by a lot, so I can ignore entire
directories.

However, I get inconsistent results between using the --directory flag
and not.  To demonstrate this, I created a super tiny repository[2]. 
The repository ignores all `*.mo` files.

I then do:

$ mkdir po/subdir
$ touch eo.mo po/eo.mo po/subdir/eo.mo

When I run `git ls-files --exclude-standard --ignored --others`, my
output is:

eo.mo
po/eo.mo
po/subdir/eo.mo

But when I run `git ls-files --exclude-standard --ignored --others 
--directory`, my output is:

eo.mo
po/eo.mo

Rather strangely, when I alter the command to `git ls-files --exclude-
standard --ignored --others --directory --no-empty-directory`, I get:

eo.mo
po/eo.mo
po/subdir/

This seems very counter-intuitive to me, because po/subdir/ is an empty
directory in the sense that it contains no files tracked by git.

Is this a bug, or is this a miscomprehension on my part about how `git-
ls-files` is supposed to function?

With kindness,
Carmen


[1]: <
https://github.com/fsfe/reuse-tool/blob/75c8c1ba0b7fcefc3ab4e132b539f506e18f721c/src/reuse/_util.py#L115
>
[2]: <https://github.com/carmenbianca/git-ls-files>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

                 reply	other threads:[~2019-04-18  6:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5a8939f2efddb194dadb59c946522a75c5bda53.camel@fsfe.org \
    --to=carmenbianca@fsfe.org \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).