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

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

From
Han-Wen Nienhuys <hanwen@xs4all.nl>
Date
Aug 4, 2008, 03:06 UTC
Message-ID
<g75ror$uav$1@ger.gmane.org>
In-Reply-To
<bad7471c0808011250v569ffaaby9e20a5ba1f971927@mail.gmail.com>
Robert Blum escreveu:
> 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
Show 7 quoted lines
> +if os.name == 'nt':
> +    def os_chdir(dir):
> +        os.environ['PWD']=dir
> +        os.chdir(dir)
> +else:
> +    os_chdir = os.chdir
> +
Stylistic:
I think the naming is a bit ugly (os_); I would write
  def chdir(d):
     if os.name == 'nt': .. 
     os.chdir(dir)
for the rest: looks good to me.
	
-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
Previous: Simon HausmannNext: Alex Riesen
Message 4 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.