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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:06

"Robert Blum" [off-list ref] writes:
P4 on Windows expects the PWD environment variable to be set to the
current working dir, but os.chdir in python doesn't do that by default
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".  If there is none, I think your
patch, even though it looks ugly, is the least evil approach.  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)
---

Pushing it out to the list since I'm not entirely sure who the git-p4 owner
even is. CC'ed likely suspects for ownership ;)
Thanks.  I've been waiting for an Ack from somewhere or success reports
from p4 users on Windows.

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

From: Simon Hausmann <hidden>
Date: 2016-06-15 22:45:06

On Sunday 03 August 2008 23:13:42 Junio C Hamano wrote:
"Robert Blum" [off-list ref] writes:
quoted
P4 on Windows expects the PWD environment variable to be set to the
current working dir, but os.chdir in python doesn't do that by default
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".  If there is none, I think your
patch, even though it looks ugly, is the least evil approach.  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)
quoted
---

Pushing it out to the list since I'm not entirely sure who the git-p4
owner even is. CC'ed likely suspects for ownership ;)
Thanks.  I've been waiting for an Ack from somewhere or success reports
from p4 users on Windows.
Acked-by: Simon Hausmann <redacted>

It may not be the prettiest solution, but I agree it needs to be solved :)

Simon
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help