Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.eggignore does not follow .gitignore pattern behavior #140

Open
jordanbtucker opened this issue Sep 18, 2022 · 0 comments
Open

.eggignore does not follow .gitignore pattern behavior #140

jordanbtucker opened this issue Sep 18, 2022 · 0 comments

Comments

@jordanbtucker
Copy link

🐛 Bug Report

The documentation on .eggignore claims that it follows the same rules as the .gitignore pattern format. However, I've found a few examples where this isn't true.

Assume this folder structure.

├── .eggignore
├── .gitignore
├── bar
│   └── foo
├── baz
│   └── foo
│       └── bar
└── foo
    └── bar
# .gitignore
foo
# .eggignore
extends .gitignore

Apart from .gitignore and .eggignore, Git will ignore every file, including files named foo and files inside directories named foo. However, Eggs will only ignore bar/foo, i.e. files named foo but not files inside directories named foo.

# git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .eggignore
        .gitignore
# eggs publish
[INFO] Files to publish:
        - ./.eggignore  (0.000019MB)
        - ./.gitignore  (0.000004MB)
        - ./baz/foo/bar  (0MB)
        - ./foo/bar  (0MB)

We get the same behavior from both Git and Eggs, respectively, with this .gitignore.

# .gitignore
**/foo

However, with this .gitignore...

# .gitignore
foo/**

Git will only ignore foo/bar, and Eggs correctly follows this behavior.

# git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .eggignore
        .gitignore
        bar/
        baz/
# eggs publish
[INFO] Files to publish:
        - ./.eggignore  (0.000019MB)
        - ./.gitignore  (0.000007MB)
        - ./bar/foo  (0MB)
        - ./baz/foo/bar  (0MB)

Switching gears a bit, consider a folder structure like this.

├── .eggignore
├── .gitignore
├── bar
│   └── foo
└── foo

To have Git only ignore the file named foo in the top-level of our project, we would use a .gitignore like this.

# .gitignore
/foo

However, Eggs will not ignore it. To get Eggs to ignore the top-level foo file, we need a .gitignore like this.

# .gitignore
./foo

However, Git does not support dot-slash syntax to indicate project relative paths. To get this behavior to work in Git and Eggs, you need two paths.

# .gitignore
# Git:  top-level file
/foo
# Eggs: top-level file
./foo

Yet, this is still broken if the top-level foo is a directory.

├── .eggignore
├── .gitignore
├── bar
│   └── foo
└── foo
    └── bar

Using the .gitignore with both paths, Git will correctly ignore foo/bar, however Eggs will not since foo is a directory. To ignore top-level foo files and directories with both Git and Eggs, we need a .gitignore like this.

# .gitignore
# Git:  top-level file and directory
/foo
# Eggs: top-level file
./foo
# Eggs: top-level directory
./foo/**

To Reproduce

See Bug Report.

Expected behavior

.eggignore should follow the same behavior as .gitignore especially when using extends .gitignore.

Actual Behavior

See Bug Report.

Environment

  • Eggs version: 0.3.10
  • Deno version: 1.25.3
  • Operating system and version: Tested on both Windows 10 and Ubuntu 20.04

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant