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:
- users can use standard snippets, including the same blocks they use in their other
.*ignore files,
- users that complain about the structure or feature support of the file format can be pointed at git's dev team. :)
Or more generally: support what gitignore supports.
As of right now,
.dockerignorefiles with changes such as github/gitignore@7b35656 will cause the engine to choke and die with an error likeERROR: 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
However I'd argue that this is worth it:
.*ignorefiles,