From: David Turner <David.Turner@twosigma.com>
To: 'Jeff King' <peff@peff.net>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: RE: [PATCH 3/6] tmp-objdir: introduce API for temporary object directories
Date: Fri, 30 Sep 2016 23:07:11 +0000 [thread overview]
Message-ID: <b22eb24e64ee4026a04459dc02c27ff0@exmbdft7.ad.twosigma.com> (raw)
In-Reply-To: <20160930224450.zewgfqelljiwowh6@sigill.intra.peff.net>
Thanks. The rest all look good too.
> -----Original Message-----
> From: Jeff King [mailto:peff@peff.net]
> Sent: Friday, September 30, 2016 6:45 PM
> To: David Turner
> Cc: git@vger.kernel.org
> Subject: Re: [PATCH 3/6] tmp-objdir: introduce API for temporary object
> directories
>
> On Fri, Sep 30, 2016 at 09:32:04PM +0000, David Turner wrote:
>
> > > +static void env_append(struct argv_array *env, const char *key,
> > > +const char *val) {
> > > + const char *old = getenv(key);
> > > +
> > > + if (!old)
> > > + argv_array_pushf(env, "%s=%s", key, val);
> > > + else
> > > + argv_array_pushf(env, "%s=%s%c%s", key, old, PATH_SEP,
> > > val);
> > >+}
> >
> > I would like a comment explaining this function.
>
> I'll squash in:
>
> diff --git a/tmp-objdir.c b/tmp-objdir.c index c92e6cc..a98c246 100644
> --- a/tmp-objdir.c
> +++ b/tmp-objdir.c
> @@ -70,6 +70,13 @@ static void remove_tmp_objdir_on_signal(int signo)
> raise(signo);
> }
>
> +/*
> + * These env_* functions are for setting up the child environment; the
> + * "replace" variant overrides the value of any existing variable with
> +that
> + * "key". The "append" variant puts our new value at the end of a list,
> + * separated by PATH_SEP (which is what separate values in
> + * GIT_ALTERNATE_OBJECT_DIRECTORIES).
> + */
> static void env_append(struct argv_array *env, const char *key, const char
> *val) {
> const char *old = getenv(key);
>
> > > + * Finalize a temporary object directory by migrating its objects
> > > +into the main
> > > + * object database.
> > > + */
> >
> > This should mention that it frees its argument.
>
> And:
>
> diff --git a/tmp-objdir.h b/tmp-objdir.h index aa47aa9..b1e45b4 100644
> --- a/tmp-objdir.h
> +++ b/tmp-objdir.h
> @@ -35,7 +35,8 @@ const char **tmp_objdir_env(const struct tmp_objdir
> *);
>
> /*
> * Finalize a temporary object directory by migrating its objects into the main
> - * object database.
> + * object database, removing the temporary directory, and freeing any
> + * associated resources.
> */
> int tmp_objdir_migrate(struct tmp_objdir *);
>
>
> -Peff
next prev parent reply other threads:[~2016-09-30 23:13 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 19:35 [PATCH 0/6] receive-pack: quarantine pushed objects Jeff King
2016-09-30 19:35 ` [PATCH 1/6] check_connected: accept an env argument Jeff King
2016-09-30 19:36 ` [PATCH 2/6] sha1_file: always allow relative paths to alternates Jeff King
2016-10-02 9:07 ` René Scharfe
2016-10-02 13:03 ` Jeff King
2016-10-02 15:38 ` Jeff King
2016-10-02 16:59 ` Jeff King
2016-09-30 19:36 ` [PATCH 3/6] tmp-objdir: introduce API for temporary object directories Jeff King
2016-09-30 21:25 ` Junio C Hamano
2016-09-30 22:13 ` Jeff King
2016-09-30 21:32 ` David Turner
2016-09-30 22:44 ` Jeff King
2016-09-30 23:07 ` David Turner [this message]
2016-09-30 19:36 ` [PATCH 4/6] receive-pack: quarantine objects until pre-receive accepts Jeff King
2016-10-01 9:12 ` Jeff King
2017-04-08 14:53 ` Ævar Arnfjörð Bjarmason
2017-04-10 21:14 ` Jeff King
2016-09-30 19:36 ` [PATCH 5/6] tmp-objdir: put quarantine information in the environment Jeff King
2016-09-30 19:36 ` [PATCH 6/6] tmp-objdir: do not migrate files starting with '.' Jeff King
2016-10-02 9:20 ` [PATCH 0/6] receive-pack: quarantine pushed objects Christian Couder
2016-10-02 13:02 ` Jeff King
2016-10-03 6:45 ` Christian Couder
2016-10-03 20:48 ` [PATCH v2 0/5] " Jeff King
2016-10-03 20:49 ` [PATCH v2 1/5] check_connected: accept an env argument Jeff King
2016-10-05 19:01 ` Jakub Narębski
2016-10-05 19:06 ` Jeff King
2016-10-03 20:49 ` [PATCH v2 2/5] tmp-objdir: introduce API for temporary object directories Jeff King
2016-10-03 20:49 ` [PATCH v2 3/5] receive-pack: quarantine objects until pre-receive accepts Jeff King
2016-10-03 20:49 ` [PATCH v2 4/5] tmp-objdir: put quarantine information in the environment Jeff King
2016-10-03 20:49 ` [PATCH v2 5/5] tmp-objdir: do not migrate files starting with '.' Jeff King
2016-10-03 21:25 ` [PATCH v2 0/5] receive-pack: quarantine pushed objects Junio C Hamano
2016-10-03 21:28 ` Jeff King
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=b22eb24e64ee4026a04459dc02c27ff0@exmbdft7.ad.twosigma.com \
--to=david.turner@twosigma.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).