Canop / Canop/broot

Files in directories with whitelist-style .gitignore are hidden

Open
#446 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
12.9k
Forks
315
Avg merge
1d 6h
Merged PRs (30d)
6

Description

Consider the .gitignore:

# Ignore everything, but not directories:

*
!**/

# Except the following file types:

!.gitignore

!**.txt
!**.md

Broot doesn't show any file in the directory with such .gitignore:

ls -a
.  ..  credits.txt  .git  .gitignore  Readme.md

BROOT_LOG=debug br
/home/allkromm/src/bugs/broot-gitignore

mv .gitignore ..

BROOT_LOG=debug br
/home/allkromm/src/bugs/broot-gitignore
 ├──broot.log 
 ├──credits.txt 
 └──Readme.md 

Steps to reproduce the behavior:

  1. Open a directory with git repository and gitignore like described above (minimal example attached);
  2. Launch Broot;
  3. Type pt;

Expected behavior: credits.txt and Readme.md files are displayed. Actual behavior: they are not displayed.

Files are displayed if .gitignore file is removed from the directory, or if gi flag is no.

  • broot version: broot 1.6.3
  • OS: Debian
  • Version: 11.0

broot.log
broot-gitignore.zip

There is a mention of whitelist-style .gitignore files here: https://github.com/Canop/broot/issues/35#issuecomment-753346679

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached broot-gitignore.zip and reproduce the case using the shown whitelist-style .gitignore, BROOT_LOG=debug br, and the pt command. Compare filtering with and without the gi flag; done means credits.txt and Readme.md are displayed while the gitignore behavior remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.