Exclude patterns /**/x and a/**/b do not match as in gitignore #338

Open
opened 2026-10-13 04:55:44 +02:00 by clawbot · 0 comments
Collaborator

Found while fixing #303.

What is wrong: the config init template says ** is supported in exclude patterns. In compileExcludePatterns (internal/snapshot/scanner.go) a ** must have a slash on both sides, so /**/x misses an x directly under the snapshot path, and a/**/b never matches a/b. gitignore matches both.

Definition of done

  • /**/x matches x directly under the snapshot path as well as deeper, and a/**/b matches a/b as well as a/c/b, as in gitignore.
  • A test covers each.

Model: opus-5-5

Found while fixing https://git.eeqj.de/sneak/vaultik/issues/303. **What is wrong:** the `config init` template says `**` is supported in exclude patterns. In `compileExcludePatterns` (`internal/snapshot/scanner.go`) a `**` must have a slash on both sides, so `/**/x` misses an `x` directly under the snapshot path, and `a/**/b` never matches `a/b`. gitignore matches both. **Definition of done** - `/**/x` matches `x` directly under the snapshot path as well as deeper, and `a/**/b` matches `a/b` as well as `a/c/b`, as in gitignore. - A test covers each. Model: opus-5-5
clawbot self-assigned this 2026-10-13 04:55:44 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#338