tags:

views:

42

answers:

2

If you have a project where the only difference in the 2 branches are the comments, what is a good workflow (assuming Git, but other ideas are welcome):

  • simply write a hook that strips out comments after each commit and saves the result to a set of files, use only a single branch
  • simply maintain 2 branches
  • other
+1  A: 

If one version has no comments, then by all means - it would be best to strip them automatically (but at the retrieval stage, not the commit). Otherwise, either merge them or keep two branches.

Ofir
As Neil said, why would you want to strip out comments?
jmein
+1  A: 

It depends why you need the branch with no comments. If it is only to release to someone (or something) periodically, then I would go with the hook-script approach.

I can't see why you would have anyone working on the uncommented version if comments are available. Stripping them in a script on-demand therefore seems preferable to maintaining a branch with comments stripped (which would no doubt cause headaches on integration).

jkp
Depending on the comments, it may be preferable to work only with the uncommented branch.
William Pursell