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

Fwd: [PATCH] git-p4: chdir now properly sets PWD environment variable in msysGit

From
RBRobert Blum <rob.blum@gmail.com>
Date
Aug 4, 2008, 13:04 UTC
Message-ID
<bad7471c0808040604p6de570f1k35aa4e76757ca6fd@mail.gmail.com>
In-Reply-To
<bad7471c0808040601y10cceb44idcde5a4a8f415769@mail.gmail.com>
Forgot reply-all - forwarding to list....
> Missing full stop at the end of sentence aside, this comment makes me
> wonder if there is an optional way to have it set it, as opposed to the
> inconvenient way it behaves "by defualt".

Not that I'm aware of. My 'by default' comment refers to a default Python installation, i.e. unpatched. As far as I know, the real culprit in this is p4. I'd argue it's a bug, since they should be using getcwd(), not getpwd(). Moot point - I don't want to wait for git-p4 until I have convinced perforce to fix this and a new p4 rolls around ;)

>  If there is none, I think your
> patch, even though it looks ugly, is the least evil approach.
Warms the cockles of my heart ;)
Show 7 quoted lines
> Another way
> might be to wrap callsites of system() by introducing a "run_p4" function,
> like:
>
>        def run_p4(arg):
>                os.environ['PWD'] = os.getcwd() if os.name == 'nt'
>                return system(arg)
Happy to submit a new patch with that, if that's preferred.
> Thanks.  I've been waiting for an Ack from somewhere or success reports
> from p4 users on Windows.

Han-Wen seems OK with it. (BTW: Who *is* the maintainer of git-p4?) But hold off on applying - I'll resubmit with the run_p4 approach today.

(Oh, and of course: Works for me ;)
 - Robert
Previous: Alex RiesenNext: Junio C Hamano
Message 6 of 8 in “git-p4: chdir now properly sets PWD environment variable in msysGit”
  1. git-p4: chdir now properly sets PWD environment variable in msysGitRobert Blum, Aug 1, 2008
  2. Junio C HamanoAug 3, 2008
  3. Simon HausmannAug 5, 2008
  4. Han-Wen NienhuysAug 4, 2008
  5. Alex RiesenAug 5, 2008
  6. Fwd: [PATCH] git-p4: chdir now properly sets PWD environment variable in msysGitRobert Blum, Aug 4, 2008
  7. Junio C HamanoAug 16, 2008
  8. Junio C HamanoAug 16, 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.