I have a particular report that I am asked to run from time to time. The details are slightly different each time – different date ranges, different selection criteria – but structurally, the report is fairly stable. I do make some structural changes from time to time, however.
I have two hopes for these reports:
- To be able to reproduce any report at a later date.
- To be able to review the structural changes made to the report over time.
Right now, I just have a folder with a master script, which I modify for every iteration of the report, and subfolders where I save a snapshot of the master script and the data for each run.
Maybe that’s good enough. But I’ve started using git to manage my (much more complex) data analysis scripts, and I was wondering if there was a way to use it here (and for myriad similar reports) that would allow for more robust version control.
I can think of a few different ways to do so: make a branch for each report, but only merge structural changes back onto the master; clone the master into the subfolder for a new report, make changes there, push back structural changes; etc. But I really don’t even know enough to be able to separate insane ideas from plausible ones, much less good ones. What do you think?
I’d personally go for your first suggestion:
This is by far the easiest conceptually, and it by merging the structural changes into the head revision, you can apply them as and when required to the other branches (when requested). The only downside is the amount of branches you’ll leave lying around, it sounds like an infrequent request and a good naming scheme should sort that out.