[p4ruby] fix for symlink-in-PWD problem

Tony Smith tony at smee.org
Mon Mar 10 09:54:43 PDT 2008


On Monday 10 March 2008 15:57:36 bob p4 wrote:
> > I don't think this is a problem that can be solved once, for everyone; if
> > it was, I'd have done so long ago.
>
> Why do you think that?  We clearly agree that deleting PWD works.

Yes, absolutely.

> What is the problem? 

The problem is that not everyone wants what you want. In fact, other customers 
are _relying_ on the default behaviour, and we simply don't want to break 
their scripts.

> If you were omniscient then you would have done 
> so long ago, but of course none of us are.
>
> > > The above fix also has the advantage of not polluting ENV with a
> > >
> >  > deleted PWD, which may be used by some other component.
> >
> >  I'm not a fan of the fix as it's been coded, but I'll take another look
> > at the problem and see if any better solutions come to light.
>
> The "fix," "as it's been coded," is obviously a workaround for an end
> user that wants the correct behavior immediately, without recompiling
> P4.so.  The actual fix would be to p4.cpp.  However the workaround
> shows exactly what to do: delete PWD from the environment, call into
> perforce, then restore PWD if it previously existed.  If there is
> something wrong with this plan then please tell us.

It's ugly, that's all. It's not 'wrong' as it achieves the right result, but 
to my eyes it's ugly. So we're looking for a better solution. For example, a 
little investigation shows that the following also works in P4Ruby:

	p4 = P4.new
	p4.cwd = Dir.getwd
	p4.connect

Does that help? 

Tony



More information about the p4ruby mailing list