I'm wondering if there is some trick to keep a file in the repository that will be fetched by anyone checking out the repository, but that will never be committed to the repository unless some kind of explicit action is performed.
Basically, what I'm looking for is a way to have files with default values that can be modified locally without affecting the repository.
I know of two ways to kind of do this, but I'm looking for a better way:
Both of these solutions require additional action from the developers, and I'm afraid I can't trust that everyone will follow the correct procedures... Is there a way to make the process transparent to the developers?
Unfortunatly, I've never seen an "easy and out of the box" way to do that.
I'm generally using your 2) solution, based on files with some kind of .default extension.
A solution that might be possible, though, is to use some pre-commit SVN hook, that would :
And, as a safety precaution, as you might, one day, need to modify one of those "not modifiable" files, you might want to add a test on the commit-comment :
I've never tested this precise situation, but I've already seen pre-commit hooks used to ensure some conditions like "each commit must have a comment longer than X characters" -- so it should be possible...
For more informations, you can take a look at Implementing Repository Hooks and at pre-commit.
I just hope you can get the list of files that are affected by the current commit... looking at this article, it seems to be possible, using svnlook.
I would use your method #2, and then add defensive code to the application that checks the developer did the right thing to create the local file, and alerts them if they got it wrong.
If your project is like every other that I've worked on, there's probably a checklist of things a new developer has to get right before they have a valid working tree. Add this to that list, and make the application check its correctness as much as possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With