Binary .pkl files

I have a git commit hook which pushes all WATO changes to a local gitea instance. I note that binary .pkl files are included - what are they, are they needed for git, and if not, how would I ignore them, given this comment in the .gitignore file?

“This file is under control of Checkmk. Please don’t modify it.
Your changes will be overwritten.”

These pickle files are a binary representation of their accompanying .mk files.
This allows Checkmk to faster ingest them in case the .mk has not been changed.
This speeds up the activation process.

They should be “gitignored” as they can be restored from the .mk files.

How to ignore them though, if the .gitignore file is overwritten as per the comment in the file?

To my knowledge it is not possible to modify the .gitignore files, because they are overwritten. There is no option to modify the contents. This is part of the _write_gitignore_files function in lib/python3/cmk/gui/watolib/git.py (at least in version 2.3).
This would require a feature request.

I think that’s more of a Bug that currently the pickle files are checked in into the repo. They should be ignored as default.

4 Likes

Any Check MK guys here willing to pick this up as a bug or shall I raise it?

Put the files and patterns to ignore into the file

.git/info/exclude

in the git directory. If the file does not yet exist, then create it. It has the same syntax as .gitignore but is not part of the working tree, i.e. it is not checked in.
The file is meant for files that you want to ignore but are not of general interest.

Further information about ignoring files in git can be found in the documentation: Git - gitignore Documentation

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.