standard-version icon indicating copy to clipboard operation
standard-version copied to clipboard

Wrong interpretation of the .gitignore (library fails silently)

Open dawidchyrzynski opened this issue 4 years ago • 1 comments

Describe the bug The library fails silently (does nothing) if gitignore file contains a rule that's meant to ignore entries (directories/files) with a specific name (entry without trailing slash at the end) and this name is used in one of the parent directories. For example, if my gitignore like looks like this:

builds

and if my project's root directory is /Volumes/Projects/XX/builds/ci-1/ then running standard-version in the ci-1 will fail as it ignores all files due to one of the parents being "builds".

Current behavior The app's version is not bumped up.

Expected behavior The library should bump the app's version.

Environment

  • standard-version version(s): 9.2.0
  • Node/npm version: v14.15.4
  • OS: macOS 10.15.7

Possible Solution The problem is caused by dotgitignore library that you use (https://github.com/bcoe/dotgitignore/issues/7). You may consider replacing it or at least print a warning message if none of the project's files are matched.

How to reproduce

  1. Create Node project in the following path MyApp/builds/ci-1 (that's the project's root directory where .git and package.json items are located).
  2. Add builds directory to the gitignore by just using the directory's name without a trailing slash (so it should ignore both directories and files).
  3. Run standard-version without --first-release flag. You will just get "Done" message without any other output.

dawidchyrzynski avatar Apr 26 '21 20:04 dawidchyrzynski

This also happens with a build entry https://github.com/conventional-changelog/standard-version/issues/502#issuecomment-1113865423

NathanJAdams avatar Apr 30 '22 00:04 NathanJAdams