Re: [PATCH v2 1/5] check_connected: accept an env argument
On Wed, Oct 05, 2016 at 09:01:57PM +0200, Jakub Narębski wrote: > > diff --git a/connected.h b/connected.h > > index afa48cc..4ca325f 100644 > > --- a/connected.h > > +++ b/connected.h > > @@ -33,6 +33,11 @@ struct check_connected_options { > > > > /* If non-zero, show progress as we traverse the objects. */ > > int progress; > > + > > + /* > > +* Insert these variables into the environment of the child process. > > +*/ > > + const char **env; > > }; > > Just a nitpick, but I wonder why one comment is in single-line form, > and the other uses block-form with a single line. I think I wrote something longer originally, and then shortened it before sending. I don't generally think it matters much for a case like this (if it were in the middle of code, I think the shorter form is worth doing, but here it's basically a header for this variable). -Peff
Re: [PATCH v2 1/5] check_connected: accept an env argument
W dniu 03.10.2016 o 22:49, Jeff King pisze: > diff --git a/connected.h b/connected.h > index afa48cc..4ca325f 100644 > --- a/connected.h > +++ b/connected.h > @@ -33,6 +33,11 @@ struct check_connected_options { > > /* If non-zero, show progress as we traverse the objects. */ > int progress; > + > + /* > + * Insert these variables into the environment of the child process. > + */ > + const char **env; > }; Just a nitpick, but I wonder why one comment is in single-line form, and the other uses block-form with a single line. -- Jakub Narębski, bikeshedding
[PATCH v2 1/5] check_connected: accept an env argument
This lets callers influence the environment seen by rev-list, which will be useful when we start providing quarantined objects. Signed-off-by: Jeff King --- connected.c | 1 + connected.h | 5 + 2 files changed, 6 insertions(+) diff --git a/connected.c b/connected.c index 8e3e4b1..136c2ac 100644 --- a/connected.c +++ b/connected.c @@ -63,6 +63,7 @@ int check_connected(sha1_iterate_fn fn, void *cb_data, _("Checking connectivity")); rev_list.git_cmd = 1; + rev_list.env = opt->env; rev_list.in = -1; rev_list.no_stdout = 1; if (opt->err_fd) diff --git a/connected.h b/connected.h index afa48cc..4ca325f 100644 --- a/connected.h +++ b/connected.h @@ -33,6 +33,11 @@ struct check_connected_options { /* If non-zero, show progress as we traverse the objects. */ int progress; + + /* +* Insert these variables into the environment of the child process. +*/ + const char **env; }; #define CHECK_CONNECTED_INIT { 0 } -- 2.10.0.618.g82cc264