my team and I have to do work on 1 analysis file. To avoid losing changes, we have agreed that only 1 person is allowed to apply changes at a time. To keep track of the changes we decided to use Git. So we put the analysis file in a Git repository. That way we can use the commit messages to refer to specific work being done in the past (i.e. if we need to revert the file to a previous state).
Having said that, the above way of work is not ideal. Normally in a version control project, we should be able to collaborate and we should be able to resolve "Merge conflicts" if another person has changed the same line of a file and decided what change we would like to pick "theirs" or "ours". So I decided to experiment with the analysis file and unzip it to its consisting files:
Most of the files (except the image and the txt file) are XML files which are run through a minification algorithm (to take less space on disk) so there is no formatting - everything is on 1 line. For example, this is how the "7.11-AnalysisDocument.xml" looks like (note the length of the file):
In the current state of all of these XML files, it's impossible to use a version control system like Git as they track changes on individual lines of code and in that case, all of the XML files have only 1 line of code. So even if we put the unzipped version of our analysis file into Git it will be pointless as it git will show that the whole line has changed when somebody applies a change to the document.
So I thought maybe we should create a script and attach it to the pre-commit Git hook (git allows us to execute a script before we execute the commit action) that will:
- unzip the document
- format all of its XML files in there so that everything is formatted on the appropriate line (see below)
- optionaly zip it again into a the file with extension "dxp"
However, that sounds like overcomplicating the initial problem, there has to be an easier way to do that. Can anybody give me any pointers on how a team can collaborate on working with 1 analysis file without losing changes?