Re: [PATCH/RFC] Reduce parse-options.o dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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]
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]