Re: [PATCH/RFC] Reduce parse-options.o dependencies
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jun 29, 2011, 20:29 UTC
- Message-ID
- <20110629202959.GJ22556@elie>
- 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.
Show 10 quoted lines
> 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]