[p4] Workspace option: exclusive open
Ivey, William
william_ivey at bmc.com
Sun Sep 16 10:07:04 PDT 2007
I disagree on the fundamental basis that it complicates maintenance of
multiple
releases and creates reasons for developers to avoid integrating
promptly. That is
our number one cause of failure when it comes to integrations.
> Using GUI tools, changing the workspace in the drop-down or by opening
another window
> is an easy operation.
Easy, but not fast. There is a noticeable delay for me, and I'm in the
same building as the
server. For our developers connecting from Europe and India, it's really
annoying.
To do this five times (which would be required to propogate a change to
all the active
branches, on average) is unacceptable. None of our developers have that
kind of
patience. (Neither do their managers.)
> You don't need to "see" the source branch in order to integrate from
it (i.e. use it as the
> source of an integration).
Technically, no, but my experience is that developers who don't see both
source and
destination either make mistakes or forget to integrate at all.
What was your experience before you switched to using multiple
workspaces? In my
case, we've had zero problems related to single workspaces and
continuing problems
with multiples. (Some of our developers do create multiple workspaces.
That's where I
see most of our problems.) I have to go with my own experience on this
one, your
mileage may vary.
-Wm
________________________________
From: Stephen Vance [mailto:steve at vance.com]
Sent: Friday, September 14, 2007 7:32 PM
To: Gabor Maghera
Cc: Ivey, William; perforce-user at perforce.com
Subject: Re: [p4] Workspace option: exclusive open
I agree with Gabor that one branch per workspace is a best practice.
Before I detail why and clarify what I see as possible misconceptions in
the thread, let me also say that this opinion is not universal within
Perforce or the consultant and trainer community as far as I can tell,
and I've had several explicit discussions on the topic. What seems to be
the common ground between whether it's a best practice or not is that
one branch per workspace is a safe approach for beginners and a not
inadvisable discipline for everyone, while there are certain perceived
conveniences for having multiple branches in a workspace.
First, here are the top reasons I prefer one branch per workspace, even
as a discipline for experiences users.
1. A changelist is strictly associated with a workspace. As a
logical unit of work, a changelist should only apply to one branch if
your branches represent your process the way they should. If the "same
change" needs to be applied to multiple branches, it should be
propagated through integration and those integrations should be in a
different changelist from the original modification. One branch per
workspace prevents you from composing, accidentally or deliberately,
changelists that consist of modifications on multiple branches.
2. To perform an integration, you *only* need to map the target of
the integration into your workspace. The source already exists on the
server and is read-only. Perforce knows where to get it. It doesn't need
to be on your local disk. Having your target branch as the only branch
in the workspace prevents several common errors that affect even
seasoned users. If you forget the '-r' option to integ with a branch
spec, you'll get an error rather than an undesired result on source that
could possibly be open for edit. If you make a mistake in your source
specification, you get an error rather than undesirable results.
3. One branch per workspace reinforces the concept of a workspace
as exactly that, a place where you do some specified set of work. This
seems trivial, but it means that you encapsulate some set of related
tasks in their own area. It also means that if you have two sets of
tasks that affect the same source, you have the option to create a
workspace for each mapped in the same way, but with the different tasks
independent of one another.
Now for the clarifications:
* Using P4CONFIG, you can switch workspaces by changing
directories as easily as you can change "branches" by changing
directories in a larger workspace.
* Using GUI tools, changing the workspace in the drop-down or by
opening another window is an easy operation.
* Since GUI tools have no concept of "current directory" it's even
easier to make the above-mentioned integration mistakes in a larger
workspace.
* You don't need to "see" the source branch in order to integrate
from it (i.e. use it as the source of an integration).
* The only additional overhead for a workspace is an additional
client spec and possibly an extra P4CONFIG file. If you were going to
sync from that tree anyway, there's no additional disk usage.
Anyway, that's my $0.02. Really, neither is right or wrong. One can be
safer, one can be more convenient depending on your work habits.
Steve
Gabor Maghera wrote:
I think we are on the same page as far as workspace or client
definitions,
let's call it the client workspace as Perforce does, perhaps.
And you are correct, in order to integrate you do need a workspace which
encompasses the branch and the parent codeline. Using dedicated
workspace
for each codeline is a best practice for doing development work in that
codeline other then integrating. That's a recommendation to be given to
developers who do work sometimes "here" and sometimes "there" as far as
codelines go.
Have a good weekend all,
Gabor
On 9/14/07, Ivey, William <william_ivey at bmc.com>
<mailto:william_ivey at bmc.com> wrote:
If you're workspace can only see one branch, how do you
integrate
between release branches? (I can't see this being a best
practice if
it doesn't work - and, by the way, I got the idea from
Perforce's own
documentation.)
If I have two workspaces and change directories, but forget to
change
workspaces (and P4CONFIG doesn't work with the GUI) then I might
not submit a file into the wrong branch - but I will create a
useless
change on the wrong branch, and fail to update the branch I
intended.
Whereas if I have one workspace that maps multiple server
branches
to multiple directories on my system, changing directories is
all I need
to do and everything will go as intended. Perforce automatically
directs
the command to the right branch based on my local directory path
no
matter what client I happen to use. That's part of its design
and I
don't
see any easy way to create the problem you describe by doing it
this
way.
I think you are misinterpreting the term "workspace" (replace it
with
"client" and maybe my meaning will be clearer). I'm certainly
not
talking about mixing file from multiple branches in a single
directory
on my system.
-Wm
________________________________
From: Gabor Maghera [mailto:gmaghera at gmail.com]
Sent: Friday, September 14, 2007 3:35 PM
To: Ivey, William
Cc: Rick Macdonald; perforce-user at perforce.com
Subject: Re: [p4] Workspace option: exclusive open
It may not be as efficient to set up a dedicated workspace for
each
codeline, but it is a safety guard and a best practice. This is
especially important for release codelines but it also helps
with
development codelines. The idea is to reduce the likelihood of
someone
checking code into an inappropriate branch and therefore
destabilizing
it.
_______________________________________________
perforce-user mailing list - perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
_______________________________________________
perforce-user mailing list - perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
--
Stephen Vance
www.vance.com
More information about the perforce-user
mailing list