Dig.glob and dot file behavior: subtle edge case?

Ran into a small oddity with Dir.glob and how it matches dotfiles. Looked into it: not matching hidden files is standard behavior and one has to use the option dot_files to get hidden file to match. Ok. However:

  • * │ [“subdir”] - doesn’t match .hidden

  • */ [“subdir/”, “.hidden/”] - DOES match .hidden/

This inconsistency is why **/*/.gitignore “works” - when * is followed by /, it inexplicably matches dotfiles.

I don’t think I understand what your examples are supposed to mean. I can’t understand the notation.
Could you perhaps clarify the cases in text?

This was motivated from the code that was removed in Use match: :dot_files for glob instead of workaround · trans/ignoreme@26a1914 · GitHub

Dir.glob("*")  # does not match hidden paths (standard behavior)
Dir.glob("*/") # does match hidden paths  

Dir.glob(“*/”) is match with sub-directory in current folder, even though it does seem a bit inconsistent, a directory is also a file technically.

Ah, gotcha :+1:
This looks like a bug, actually. */ should not match .dir/, just like * doesn’t match .file.