Skip to content

Add support for character classes #11

@kf6kjg

Description

@kf6kjg

Or more generally: support what gitignore supports.

As of right now, .dockerignore files with changes such as github/gitignore@7b35656 will cause the engine to choke and die with an error like ERROR: failed to solve: Internal: rpc error: code = Internal desc = rpc error: code = Internal desc = header key "exclude-patterns" contains value with non-printable ASCII characters.

My recommendation: move away from DIY ignorefile parsing and use an existing lib, maybe even a part of go-git's implementation. I'd personally recommend a lib instead of a source code copy, but they are Apache 2 as well, so there shouldn't be any license issue from code copying - just a maintenance burden, but one I'd argue is less than the current maintenance burden.

This kind of change might be a breaking change for some users: matching outcomes may change for

  • malformed/ambiguous patterns,
  • path normalization differences (filepath.Clean, separators),
  • bracket/escape semantics,
  • negation ordering edge cases.

However I'd argue that this is worth it:

  1. users can use standard snippets, including the same blocks they use in their other .*ignore files,
  2. users that complain about the structure or feature support of the file format can be pointed at git's dev team. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions