git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: git-p4, msysgit, and strange behavior

From
BRBlum, Robert <rblum@pandemicstudios.com>
Date
Jul 31, 2008, 19:03 UTC
Message-ID
<8778C923356C6541B263428246AE9C2A4FE2966AB2@NA-MAIL-2-2.rws.ad.ea.com>
In-Reply-To
<20080731183641.GB31085@cuci.nl>
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
Message 1 of 1 in “RE: git-p4, msysgit, and strange behavior”
  1. Blum, RobertJul 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.