views:

43

answers:

1

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?

+2  A: 

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.

Pekka