From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Sixt <johannes.sixt@telecom.at>, git@vger.kernel.org
Subject: Re: [PATCH 1/5] Change git_connect() to return a struct child_process instead of a pid_t.
Date: Mon, 01 Oct 2007 11:08:12 +0200 [thread overview]
Message-ID: <4700B8FC.70704@viscovery.net> (raw)
In-Reply-To: <7vtzpbrzye.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
> Johannes Sixt <j.sixt@viscovery.net> writes:
>> Letting git_connect() die on error unconditionally is poison for any
>> libification efforts. So here's a plan:
>>
>> 1. Let git_connect() return a struct child_process even for the
>> non-forking case. This way a return value of NULL can uniquely
>> identify a failure.
>> ...
>> Since my patch doesn't do (1), it can't do (2), i.e. keep the error
>> checks -
>> they must be removed because no unique failure value exists. So I
>> could complete (1) in a new version of this patch, in order to also do
>> (2). What is your preference?
>
> In any case, I'd rather first have one that hides fork/exec
> behind child_process first without changing the call to die() in
> git_connect() in this round. I am still in "post feature
> release clean-up" mood ;-)
Sure: The die()s are converted in a later step.
My problem is that if I don't wrap the non-fork connections somehow in this
first round, I *must* remove the error checks because there is no unique
failure return value anymore.
> As to error indication, it somehow does not feel right to return
> something called "child _process_" structure when we want to
> tell the caller that there is no process to wait for in the
> no-error case, although the fact that we can use .in/.out fd in
> the structure when we _do_ have child process is attractive.
Did you mean: "even if we don't have a child process"?
How about a typedef if you dislike the name?
> As an alternative, we could keep the "NULL return means there
> was no need to fork" semantics of git_connect(), and instead add
> "int *status_ret" parameter for the caller to check.
Seriously? Add an *out* parameter when we can get rid of one and have a
return value, too?
-- Hannes
next prev parent reply other threads:[~2007-10-01 9:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-30 20:09 [PATCH 0/5] fork/exec removal series Johannes Sixt
2007-09-30 20:09 ` [PATCH 1/5] Change git_connect() to return a struct child_process instead of a pid_t Johannes Sixt
2007-09-30 20:09 ` [PATCH 2/5] Use start_command() in git_connect() instead of explicit fork/exec Johannes Sixt
2007-09-30 20:09 ` [PATCH 3/5] Use start_command() to run the filter " Johannes Sixt
2007-09-30 20:10 ` [PATCH 4/5] Use run_command() to spawn external diff programs instead of fork/exec Johannes Sixt
2007-09-30 20:10 ` [PATCH 5/5] Use start_comand() in builtin-fetch-pack.c instead of explicit fork/exec Johannes Sixt
2007-09-30 21:10 ` [PATCH 4/5] Use run_command() to spawn external diff programs instead of fork/exec Johannes Schindelin
2007-09-30 21:07 ` [PATCH 3/5] Use start_command() to run the filter instead of explicit fork/exec Johannes Schindelin
2007-09-30 20:43 ` [PATCH 1/5] Change git_connect() to return a struct child_process instead of a pid_t Junio C Hamano
2007-09-30 21:40 ` Johannes Sixt
2007-10-03 20:09 ` [PATCH 0/5, resend] fork/exec removal series Johannes Sixt
2007-10-03 20:09 ` [PATCH 1/5] Change git_connect() to return a struct child_process instead of a pid_t Johannes Sixt
2007-10-03 20:09 ` [PATCH 2/5] Use start_command() in git_connect() instead of explicit fork/exec Johannes Sixt
2007-10-03 20:09 ` [PATCH 3/5] Use start_command() to run the filter " Johannes Sixt
2007-10-03 20:09 ` [PATCH 4/5] Use run_command() to spawn external diff programs instead of fork/exec Johannes Sixt
2007-10-03 20:09 ` [PATCH 5/5] Use start_comand() in builtin-fetch-pack.c instead of explicit fork/exec Johannes Sixt
2007-10-04 8:55 ` Junio C Hamano
2007-10-04 9:22 ` Johannes Sixt
2007-10-04 20:11 ` Johannes Sixt
2007-10-01 7:23 ` [PATCH 1/5] Change git_connect() to return a struct child_process instead of a pid_t Johannes Sixt
2007-10-01 8:39 ` Junio C Hamano
2007-10-01 9:08 ` Johannes Sixt [this message]
2007-10-02 17:54 ` Junio C Hamano
2007-09-30 21:04 ` Johannes Schindelin
2007-09-30 20:20 ` [PATCH 0/5] fork/exec removal series Junio C Hamano
2007-09-30 21:14 ` Johannes Schindelin
2007-09-30 21:34 ` Johannes Sixt
2007-09-30 21:43 ` Johannes Schindelin
2007-10-01 7:07 ` Johannes Sixt
2007-10-01 9:49 ` David Kastrup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4700B8FC.70704@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.sixt@telecom.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).