stow icon indicating copy to clipboard operation
stow copied to clipboard

Ignore Only Works Correctly in every scenario with --no-folding

Open Educpf opened this issue 4 months ago • 1 comments

Description

Any method to exclude specific files in Stow is only respected if --no-folding is also used. Without --no-folding, Stow may create a symlink for the whole package folder, ignoring the file-level exclusions.

Steps to Reproduce

  1. Create a package folder with some files such that stowing would normally create a folder link (folding).

  2. Create a test file in your package folder, e.g., something.ignore.

  3. Run:

    stow -R --ignore='\.ignore$' mypackage
    
  4. Observe that something.ignore is still linked.

  5. Now run:

    stow --no-folding --ignore='\.ignore$' mypackage
    
  6. Observe that something.ignore is correctly ignored.

Expected Behavior

The --ignore flag should work regardless of the --no-folding option. Stow should automatically detect that folding isn't possible due to ignored files.

Actual Behavior

Files matching the --ignore pattern are only ignored if --no-folding is used, or if the file layout naturally prevents folding.

Environment

  • GNU Stow version: 2.4.1
  • OS: Arch Linux

Notes

This behavior is reproducible with .stow-local-ignore and .stow-global-ignore as well—--no-folding is required for file-level ignores to be respected. This appears to be a bug in how Stow handles folding versus individual file ignores.

Educpf avatar Aug 30 '25 01:08 Educpf

Thanks for the report, sounds like this is probably a bug.

aspiers avatar Nov 29 '25 16:11 aspiers