Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Robert Blum <hidden>
Date: 2016-06-15 22:45:06

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 ;)
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help