Blitz: Blitz doesn't ignore directories added to `.gitignore`

Created on 24 Aug 2020  路  15Comments  路  Source: blitz-js/blitz

What is the problem?

Blitz doesn't ignore directories added to .gitignore

Steps to Reproduce

  1. Add a directory to .gitignore, for example /dir/
  2. Add some files to that directory
  3. Run blitz start

Workaround

Currently, you can work around this issue by adding /dir/**/* to .gitignore.

Versions

macOS Catalina | darwin-x64 | Node: v12.16.2

blitz: 0.18.0 (global)
blitz: 0.18.0 (local)

  Package manager: npm
  System:
    OS: macOS 10.15.6
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 1.04 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
    Yarn: 1.22.0 - ~/.yarn/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/cli: 2.5.1 => 2.5.1
    @prisma/client: 2.5.1 => 2.5.1
    blitz: 0.18.0 => 0.18.0
    react: 0.0.0-experimental-33c3af284 => 0.0.0-experimental-33c3af284
    react-dom: 0.0.0-experimental-33c3af284 => 0.0.0-experimental-33c3af284
    typescript: 3.9.7 => 3.9.7

Other

Please include applicable logs and screenshots that show your problem.

kinbug scopserver statudone

All 15 comments

Hey @anteprimorac! When you say ignored by Blitz, what do you mean by that?

@flybayer it鈥檚 same as here https://github.com/blitz-js/blitz/issues/360

Ah, I forgot about that! 馃憤

Is this still relevant? I am ready to take a look.

@svobik7 yes, it is still relevant.

@flybayer does it make sense to apply the same logic to the build hash generation? With it, we could solve heroku issue in the user-land.

@svobik7 all yours!

And yes @anteprimorac I had the exact same thought

@anteprimorac I am not able to reproduce this issue in current canary neither master. Seems like re-compiling is invoked on file change only when files from /dir/ are used somewhere in the app and only if /dir/ is not in the .gitignore. Otherwise I see no re-compiling at all.

Tested in examples/auth and custom blitz new test-app.

macOS Catalina | darwin-x64 | Node: v12.14.1

blitz: 0.21.1 (global)
blitz: 0.22.2-canary.0 (local)

  Package manager: npm 
  System:
    OS: macOS 10.15.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
    Memory: 2.16 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/cli: 2.4.1 => 2.4.1 
    @prisma/client: 2.4.1 => 2.4.1 
    blitz: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: 3.9.5 => 3.9.5 

@svobik7 thanks for investigating!

@anteprimorac can you try again with the latest blitz release?

@flybayer It was indeed fixed, for the most part, in the latest canary however while testing it I encountered that .git/info/exclude files were not being taken into account (yes, I keep a lot of vscode related crap in that repo ) so I added a few extra lines and tests.

@ntgussoni Looking at the git docs https://git-scm.com/docs/gitignore apparently on arch linux it appears you can add a global gitignore. $XDG_CONFIG_HOME/git/ignore would this be relevant here too?

@ntgussoni Looking at the git docs https://git-scm.com/docs/gitignore apparently on arch linux it appears you can add a global gitignore. $XDG_CONFIG_HOME/git/ignore would this be relevant here too?

It definetly is, I'll add that as well

@ntgussoni Looking at the git docs https://git-scm.com/docs/gitignore apparently on arch linux it appears you can add a global gitignore. $XDG_CONFIG_HOME/git/ignore would this be relevant here too?

@ryardley Are we using any library to display git information?

I found this https://github.com/steveukx/git-js and I think it's quite useful, specially since a lot of the git folders are configurable like the.git folder or the global.

Cool. I think so far we just use child process manually to run git commands and we don't really need to run git commands around the server and file-pipeline modules really but that looks good to know about.

If I am getting it right the last thing missing here is adding patterns from .git/info/exclude to our server ignore config?

would that cover your local env @ntgussoni ?

If I am getting it right the last thing missing here is adding patterns from .git/info/exclude to our server ignore config?

would that cover your local env @ntgussoni ?

I added that in my pr up there. Im gonna update it to also make use of the global gitignore

Was this page helpful?
0 / 5 - 0 ratings