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

Re: [PATCH] Replace git-cvsimport with a rewrite that fixes major bugs.

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 3, 2013, 15:22 UTC
Message-ID
<7vip7expd8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CALWbr2xx0beca_LUHO45pGMZ4Y0jZ9-iMWq8WBO6PmW==Ysw=A@mail.gmail.com>
Antoine Pelisse <apelisse@gmail.com> writes:
>> Doesn't Python come with a standard subprocess module that lets you
>> spawn external programs safely, similar to the way Perl's list form
>> open(), e.g. "open($fh, "-|", 'git', @args)", works?
... and of course a more boring "system('git', $subcmd, @args)", as well.
Show 8 quoted lines
> You mean something like this:
>
>   p1 = subprocess.Popen([backend.command()], stdout=subprocess.PIPE)
>   subprocess.Popen(["git", "fast-import", "--quiet"] + gitopts,
> cwd=outdir, stdin=p1.stdout)
>
> Assuming gitopts is a list rather than a string. (care must be taken
> with backend.command() also)
Yes.

I vaguely recall that the subprocess module once used to be one portability issue but that was between Python 2.3 and 2.4 or some ancient history, and it should no longer be relevant.

Previous: Antoine PelisseNext: Michael Haggerty
Message 23 of 24 in “Replace git-cvsimport with a rewrite that fixes major bugs.”
  1. Replace git-cvsimport with a rewrite that fixes major bugs.Eric S. Raymond, Jan 1, 2013
  2. Junio C HamanoJan 1, 2013
  3. Eric S. RaymondJan 2, 2013
  4. Junio C HamanoJan 2, 2013
  5. Jonathan NiederJan 2, 2013
  6. Eric S. RaymondJan 2, 2013
  7. Jonathan NiederJan 2, 2013
  8. Eric S. RaymondJan 2, 2013
  9. Martin LanghoffJan 2, 2013
  10. Eric S. RaymondJan 2, 2013
  11. Thomas BergJan 2, 2013
  12. Martin LanghoffJan 2, 2013
  13. Eric S. RaymondJan 2, 2013
  14. Martin LanghoffJan 2, 2013
  15. Jonathan NiederJan 2, 2013
  16. Andreas SchwabJan 2, 2013
  17. Junio C HamanoJan 2, 2013
  18. Eric S. RaymondJan 2, 2013
  19. Junio C HamanoJan 2, 2013
  20. Chris RorvickJan 3, 2013
  21. Junio C HamanoJan 3, 2013
  22. Antoine PelisseJan 3, 2013
  23. Junio C HamanoJan 3, 2013
  24. Michael HaggertyJan 3, 2013

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.