Skip to contentSkip to conversation

git-p4, msysgit, and strange behavior

DISCUSSION Blum, Robert 1 participant 1 message Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Stephen!

Quoted 1 line

greetings from RWTH-Aachen ;-).

Heh - wonder who else from back then is lingering on those lists ;)

Quoted 1 line

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