mbox series

[0/2] Lib-ify functions in builtin.h

Message ID cover.1584786523.git.liu.denton@gmail.com (mailing list archive)
Headers show
Series Lib-ify functions in builtin.h | expand

Message

Denton Liu March 21, 2020, 10:29 a.m. UTC
In builtin.h, there exist a couple of functions that are very lib-ish.
Extract these functions into their own files which should make more
organizational sense.

Denton Liu (2):
  Lib-ify fmt-merge-msg
  Lib-ify prune-packed

 Makefile                |   2 +
 builtin.h               |  16 -
 builtin/fmt-merge-msg.c | 655 +---------------------------------------
 builtin/prune-packed.c  |  44 +--
 builtin/prune.c         |   1 +
 builtin/repack.c        |   1 +
 fmt-merge-msg.c         | 653 +++++++++++++++++++++++++++++++++++++++
 fmt-merge-msg.h         |  13 +
 prune-packed.c          |  43 +++
 prune-packed.h          |   9 +
 10 files changed, 724 insertions(+), 713 deletions(-)
 create mode 100644 fmt-merge-msg.c
 create mode 100644 prune-packed.c
 create mode 100644 prune-packed.h

Comments

Junio C Hamano March 21, 2020, 7:24 p.m. UTC | #1
Denton Liu <liu.denton@gmail.com> writes:

> In builtin.h, there exist a couple of functions that are very lib-ish.
> Extract these functions into their own files which should make more
> organizational sense.

"very lib-ish" feels a bit subjective, but I agree that among those
functions that are currently only allowed to be called from a
built-in command (hence, cannot be called from anything in libgit.a
or non-builtin commands like transports), there may be some funtions
that may make sense to be callable by non-builtin users of libgit.a
(e.g. cgit perhaps?).

I do like the direction these patches are taking us to.  I just do
not know how best to phrase it, and having trouble coming up with a
non subjective description.

Thanks.

> Denton Liu (2):
>   Lib-ify fmt-merge-msg
>   Lib-ify prune-packed
>
>  Makefile                |   2 +
>  builtin.h               |  16 -
>  builtin/fmt-merge-msg.c | 655 +---------------------------------------
>  builtin/prune-packed.c  |  44 +--
>  builtin/prune.c         |   1 +
>  builtin/repack.c        |   1 +
>  fmt-merge-msg.c         | 653 +++++++++++++++++++++++++++++++++++++++
>  fmt-merge-msg.h         |  13 +
>  prune-packed.c          |  43 +++
>  prune-packed.h          |   9 +
>  10 files changed, 724 insertions(+), 713 deletions(-)
>  create mode 100644 fmt-merge-msg.c
>  create mode 100644 prune-packed.c
>  create mode 100644 prune-packed.h