4

My team is using SVN to store a lot more than just source code - we are storing all kinds of files. A process I'm working on designing is used to generate diff reports whenever a certain Excel spreadsheet is updated and acknowledged by a subset of the team. (This spreadsheet is automatically generated by a separate process; no humans ever touch it.)

Here's my workflow:

  1. Excel spreadsheet generated (call it raw.xlsx). I download the file and commit to SVN.
  2. A pre-commit hook generates a new Excel spreadsheet (call it to_review.xlsx) and commits that. An email gets sent to my team saying that a diff between raw.xlsx:HEAD and raw.xlsx:PREV was detected.
  3. Someone on my team reviews to_review.xlsx, edits as needed, and commits it.
  4. A pre- or post-commit hook then makes edits to to_review.xlsx to update a tab to reflect the edits, and commits that. (Optionally: fire an email saying that you need to now update your working copy of to_review.xlsx.) It also generates a file report.pdf that summarizes the diff of raw.xlsx:HEAD and raw.xlsx:PREV.

How okay or not-okay is it to use SVN in this manner - i.e., to edit the file a human just committed and re-commit it? The edit will never be against what the human added/removed, but by doing this the human immediately has an out-of-date copy as soon as he commits. I'm not sure how else to approach this - we can't go straight from raw.xlsx to report.pdf, a human must be in the loop with to_review.xlsx.

  • 1
    You are using SVN as a file repository with versioning. At every step, I believe that you are doing the right thing, so there is a clear, auditable trail of changes to all of the files of interest. What the hooks are doing is triggering work flows. You could do the same sorts of things on a Sharepoint server or Alfresco server using work flows and versioned file nodes, but undoubtedly for you, SVN is cheaper and has a shorter learning curve. – BobDalgleish Aug 22 '16 at 16:53
  • 1
    Why the downvote? Please feel free to edit the question or ask me to clarify if the question can be improved. – Dang Khoa Aug 22 '16 at 20:45
  • @DangKhoa: your question is fine (and is a valid one). Supposedly, the downvoter assumed that the question is off-topic, missing the fact that questions about build tools are on-topic here. It happens occasionally. – Arseni Mourzenko Oct 31 '16 at 0:08
1

The question is more about your reasonable, and automated, review process.

Commit hooks are used to make well defined changes to files. Examples could be line endings, and insertion of updated boilerplate text. I am not sure if RCS tags are expanded in the SVN saved file rather depends on your version control system. Hooks can also be used to reject invalid changes.

The use of commit hooks as described doesn't seem to fit into that category. The hooks delay commit and trigger changes in other files. There also seems to be a flaw if two people submit changes to raw.xlsx.

Is there any reason why you cannot use post-commit hooks to trigger your process without directly modifying the affected file ?

So, you submit raw.xlsx. It is saved and then causes the to_review.xlsx process.

Assuming you are allowed to reject a review the hook for that could overwrite the raw.xlsx with the preceding version. From the process description its not that clear what purposes the archive of raw.xlsx versions would be used for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.