[p4ruby] fix for symlink-in-PWD problem
jeffperforce at gmail.com
Mon Mar 10 11:11:06 PDT 2008
On Mon, Mar 10, 2008 at 12:54 PM, Tony Smith <tony at smee.org> wrote:
> 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.
I claim the fix is compatible with the default behavior; that is why I
suggested it. I may be wrong, but that remains to be shown. Can you
give an example where this would break existing code?
> > 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
> Does that help?
First and foremost, my motivation is to fix the problem permanently.
Save Joe Programmer the hassle of discovering, isolating, and
searching for solutions to this problem. I'm satisfied with whatever
fixes it; and, of course, the simpler the better.
So when you ask, "Does the above help?" it depends upon what you mean.
If you mean that Joe Programmer should be advised to add "p4.cwd =
Dir.getwd" when he runs into the problem, then this does not help.
Joe Programmer's code already contains a bug, and his googling efforts
may or may not locate this advice.
On the other hand, if you intend to integrate this fix into P4Ruby,
then it does help.
You have said, "The problem is that not everyone wants what you want."
But everybody *does* want what I want, which is for this bug to be
More information about the p4ruby