开发者

Version control of users' metadata

开发者 https://www.devze.com 2022-12-20 13:28 出处:网络
开发者_Python百科I\'ve got a question that most likely doesn\'t have a unique and clear answer. In the team we are using the SVN, many of the people are using the git-svn (treating it as a fancy SVN c

开发者_Python百科I've got a question that most likely doesn't have a unique and clear answer. In the team we are using the SVN, many of the people are using the git-svn (treating it as a fancy SVN client).

We're storing some project related publications, reports, documents in the repository under let's say trunk/Documents/*. Each of the users creates his own notes, annotations, etc. related to a given document - let's say trunk/Documents/doc1.txt. Thus in the end we've got N users having doc1.txt.metadata.

What are your recommendations for storing this metadata? Branches for each user metadata?


As the files are going to differ by user, the cleanest way I can think of is keeping text files like doc1.txt.metadata.username. Keeping separate branches per user metafile sounds complicated to me, and hard to work with in everyday use.

There would be be the idea of automating this using a pre- and/or post-commit hook, but it is discouraged in the SVN book:

While hook scripts can do almost anything, there is one dimension in which hook script authors should show restraint: do not modify a commit transaction using hook scripts. ... Instead of modifying the transaction, you should simply validate the transaction in the pre-commit hook and reject the commit if it does not meet the desired requirements. As a bonus, your users will learn the value of careful, compliance-minded work habits.

The simplest thing might be to establish doc1.txt.metadata.username as a rule, and to write a pre-commit script that rejects any commits of .metadata files without the current user name as the extension.

0

精彩评论

暂无评论...
验证码 换一张
取 消