On Tue, Oct 16, 2018 at 04:48:13PM -0700, Stas Bekman wrote: > > >> And the devs honestly try to do their best to remember to configure the > >> filters, but for some reason they disappear for them, don't ask me why, > >> I don't know. This is an open source project team, not a work place. > > > > This sounds like it could be easily solved by continuous integration. > > You could set up a job on any of a variety of services that checks that > > a pull request or other commit is clean when when the filter runs. If > > it doesn't pass, the code doesn't merge. > > This is an excellent idea wrt to PRs. Thank you, Brian! I will implement > that. > > It doesn't help with direct commits to master, since CI would be > detecting it after it was committed. And when that happens we all know > that already because 'git pull' fails. Typically projects that have CI set up don't allow direct pushes to master, since that tends to allow to bypass CI, or they allow it only in exceptional circumstances (e.g., reverts). Also, typically most projects want to have some sort of review before code (resp. documents, other contributions) are merged. Most Git hosting platforms, including GitHub, offer protected branches, so it's something to consider. There is a possible alternative, and that's that if your project has some sort of build file (e.g., a Makefile), you can set it up to automatically insert hooks or git configuration into developers' systems, optionally only if it's in a Git repository. For example, you could add a pre-commit hook that fails if the filters are disabled. These are the approaches that tend to work well for most projects. I tend to prefer the CI approach with restricted branches because often I want to customize my hooks, but your project will decide what works best for it. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204
Attachment:
signature.asc
Description: PGP signature