Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gitattributes: remove diff attribute for cache files #593

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

hemberger
Copy link
Contributor

This makes git consider the cache files as binary for the purposes of operations like git diff, git log, git grep, etc. As a result, only meaningful content is displayed in full, making development activities much more manageable.

See https://git-scm.com/docs/gitattributes#_marking_files_as_binary for motivation.

Thinking beyond this PR, it would be nice if the tests generated and replayed their own cache files, instead of manually managing them as part of the development workflow. Making sure the cache files are correct has been one of the bigger struggles for me, especially because there isn't a way to easily set up a local testing environment that is consistent with the GitHub Actions environment (I made my own Docker setup for local testing, but it has some friction with the GHA design, and has been susceptible to subtle problems like generating incompatible cache files due to a different version of the SQL server). Is there any interest in something more auto-managed/self-contained?

This makes git consider the cache files as binary for the purposes of
operations like `git diff`, `git log`, `git grep`, etc. As a result,
only meaningful content is displayed in full, making development
activities much more manageable.

See https://git-scm.com/docs/gitattributes#_marking_files_as_binary for
motivation.
@staabm
Copy link
Owner

staabm commented Apr 3, 2023

thanks for that.

I think it would make sense to add a concrete code sample to the docs.
atm we only have a sentance which might get overlooked easily.

Thinking beyond this PR, it would be nice if the tests generated and replayed their own cache files, instead of manually managing them as part of the development workflow.

I am open to improve the workflow to ease contributions to the phpstan-dba repo.
but we have to keep in mind that this record-and-replay feature is also/mainly meant for end-users, so no matter what we do here also should work for the phpstan-dba end-user

@staabm staabm merged commit af28350 into staabm:main Apr 3, 2023
@hemberger hemberger deleted the binary-cache branch April 4, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants