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.