How best to branch in Clearcase?

流过昼夜 提交于 2019-11-30 23:57:17

You can get the creation date for a branch by using the describe command in cleartool.

cleartool describe -fmt "%d" -type martin_2322

This will printout the date and time that the branch was created. You can use this to implement your first option. For more information, you could read the following cleartool man pages, but hopefully the above command is all you need.

cleartool man describe

cleartool man fmt_ccase

A few comments:

  • a branch per task is the right granularity for modifying a set of file within a "unit of work". Provided the "task" is not too narrow, otherwise you end up with a gazillon of branches (and their associated merges)

  • when you create a config spec for a branch, you apparently forget the line for new elements (the one you "add to source control")

  • Plus you may consider branching for a fix starting point, which would solve the "old version of A.cs - the one that was latest in main when the branch was created" bit.
    I know you have too much labels already, but you could have a script to "close" a task which would (amongst other things) delete that starting label, avoiding label cluttering.

Here the config spec I would use:

element * CHECKEDOUT 
element * .../martin_2322/LATEST  
element * STARTING_LABEL_2322 -mkbranch martin_2322 
# selection rule for new "added to source control" file
element * /main/0 -mkbranch martin_2322 
load /Project/Application

I would find this much more easier than computing the date of a branch.

  • do not forget you can merge back your task to main, and merge some your files from your finished task branch to the your new current task branch as well, if you need to retrofit some your fixes back to that current task as well.

We use Clearcase, and we find that creating a branch for a release is often much easier than doing it by task. If you do create it by task, then I'd have a 'main branch' for that release, and branch the tasks off that branch, and then merge them back in when finished to merge them back to the trunk.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!