[p4] branchspec reversed or not?
rickmacd at shaw.ca
Tue Dec 20 20:34:28 PST 2005
Dan Halbert wrote:
> We are about to do our first major branch in Perforce. I read the
> Perforce technote NOTE004, which explains things quite clearly. We are
> branching from "main" to "v2.0". I can set up a branch spec, called,
> say, "main-v2.0" with a view with lines that look like:
> However, I also have a copy of Laura Wingerd's new book, Practical
> Perforce. She calls branch specs "branch views", and her examples are
> all set up in reverse. She might have a branch spec named "v2.0-main",
> with view lines like:
> She would do "p4 integ -r -b v2.0-main" in order to handle this reversal.
> So, now I'm confused. It seems as if she's introducing a new
> "Better/Best Practices in Perforce" suggestion. She prefers the reversed
> branchspecs, but doesn't really say why that I can see. I'd like to the
> "best thing" going forward. It doesn't really matter so much in this
> case, but can anyone suggestion what her motivation is here?
I wondered about this as well. The good idea that I got from this was
not the order itself but to at least name the branch spec to indicate
the source-target (left-right) codelines and order. For all these years
I've been giving mine names that only indicate the name of the feature,
so I'm always having to look at the spec to make sure I know which
direction it's written, not to mention what two codelines are specified.
I might choose v2.0-main as it indicates the optimistic and final goal
of completing the task and doing a copy of the development back to the
mainline (after "merging down", of course, and then as if doing "cp
v2.00 main"). Also, a sorted list of branchspecs would be in the order
of the source side of the branch view.
But given that Perforce just stores the view and doesn't interpret it
for anything, I figured it was just a convention that doesn't affect
Perforce or the depot itself in any way.
So, I don't have an answer but just wanted to point out the usefulness
of the source-target naming idea even if one doesn't choose the
particular order that Laura chose.
More information about the perforce-user