git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Dmitry Ivankov <divanorama@gmail.com>
Cc: git@vger.kernel.org, David Barr <davidbarr@google.com>,
	Stephen Boyd <bebarino@gmail.com>,
	Pierre Habouzit <madcoder@debian.org>
Subject: Re: [PATCH/RFC] Reduce parse-options.o dependencies
Date: Wed, 29 Jun 2011 15:29:59 -0500	[thread overview]
Message-ID: <20110629202959.GJ22556@elie> (raw)
In-Reply-To: <1309000334-31980-1-git-send-email-divanorama@gmail.com>

Hi,

Dmitry Ivankov wrote:

> Currently parse-options.o pulls quite a big bunch
> of dependencies. This complicates it's usage in
> contrib/ because it pulls external dependencies
> and it also increases executables size.

Nitpick: it is easier to read text with a little longer lines;
typical for git.git is 70 columns or so.

> Split off less generic and more internal to git
> part of parse-options.c to parse-options-git.c.

These are just callbacks for special option types, right?  Maybe
something like parse-options-cb.c would make sense.

> Declare optbug and opterror as extern as they are
> shared between these parts and also may be used
> elsewhere.

I'd suggest making this a separate patch.  The idea is that optbug
and opterror might be used by option callbacks whether they are
specific to a particular command or generic, so it is useful to
expose them as a sort of toolkit for use with OPT_CALLBACK, right?

> Move prefix_function from setup.c to abspath.c.

I think you mean "prefix_filename". :)  Makes sense ---
prefix_filename is a generically useful function, not specific to
git's filesystem layout.

> Now parse-options.o pulls just abspath.o, ctype.o,
> strbuf.o, usage.o, wrapper.o, libc directly and
> strlcpy.o indirectly.

One vague dream I've had is to submit strbuf and parse-options as CCAN
modules (http://ccan.ozlabs.org/) in the hope that others will start
to use them.  The above should make that a little easier; thanks.

> Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
> ---
>  Makefile            |    3 +-
>  abspath.c           |   28 +++++++++++++
>  parse-options-git.c |  108 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  parse-options.c     |  108 +--------------------------------------------------
>  parse-options.h     |    3 +
>  setup.c             |   28 -------------
>  6 files changed, 143 insertions(+), 135 deletions(-)
>  create mode 100644 parse-options-git.c
[diff snipped, available at
 http://thread.gmane.org/gmane.comp.version-control.git/176318]

  reply	other threads:[~2011-06-29 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-25 11:12 [PATCH/RFC] Reduce parse-options.o dependencies Dmitry Ivankov
2011-06-29 20:29 ` Jonathan Nieder [this message]
2011-07-03 11:04   ` [PATCH/RFC v2 1/2] parse-options: export opterr, optbug Dmitry Ivankov
2011-07-03 11:04   ` [PATCH/RFC v2 2/2] Reduce parse-options.o dependencies Dmitry Ivankov

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=20110629202959.GJ22556@elie \
    --to=jrnieder@gmail.com \
    --cc=bebarino@gmail.com \
    --cc=davidbarr@google.com \
    --cc=divanorama@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=madcoder@debian.org \
    /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).