threads / discuss / 14779

RE: git-p4, msysgit, and strange behavior

Subject: RE: git-p4, msysgit, and strange behavior

## tl;dr

One message between Jul 31, 2008 and Jul 31, 2008.

replies: 0people: 1as markdown or json

Blum, Robert· Jul 31, 2008, 19:03 UTC · lore
Hi Stephen!
> greetings from RWTH-Aachen ;-).
Heh - wonder who else from back then is lingering on those lists ;)
>Checked the environment?  I vaguely recall that p4 has some "magical
dependencies" there.
Yes, did that - 'p4 set' prints all relevant environment vars, and they seem to be set correctly.
You set me off on a slightly longer search, though. And indeed, here's the answer to the mystery (for the benefit of google/later readers).
Git-bash sets $PWD to your current working directory, and that variable is not affected by python's os.chdir(). (Neither in 2.5 nor 2.4, at least)
P4, for strange reasons, decides that that takes precedence over the actual working directory.
Well, actually not that strange. If p4 is using libiberty, they're using a version of getpwd that assumes that PWD is always up to date and no chdirs occur between calls to getpwd. I'm sure there was a good reason for that, but I really can't think why anybody would want to implement getpwd that way...
I'll create a patch for git-p4, but it's really up to P4 to actually *fix* that mess...
 - Robert

← back to recent threads