Skip to content

Lib-ify functions in builtin.h

Denton Liu git 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

* Rewrite commit messages to be less subjective

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Lib-ify fmt-merge-msgMakefile builtin.h builtin/fmt-merge-msg.c +2 more+668 -6650 replies
2/2Lib-ify prune-packedMakefile builtin.h builtin/prune-packed.c +4 more+56 -480 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] Lib-ify functions in builtin.h

Since the last revision, I tried to rewrite the commit messages to be more subjective but I was also having some trouble with it.

In builtin.h, there exist a couple of functions that are very "lib-ish". These functions can currently only be called by built-in commands but, unlike all of the other functions in the header, it does not make sense to impose this restriction as their functionality can be logically reused in libgit.

Extract these functions into their own files which should make more organizational sense.

Changes since v1:

* Rewrite commit messages to be less subjective

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

Range-diff against v1:
1: d989ab8b08 ! 1: fe76d79aa7 Lib-ify fmt-merge-msg
@@ Metadata
## Commit message ##
Lib-ify fmt-merge-msg

- In builtin.h, there exists the distinctly lib-ish function
- fmt_merge_msg(). Extract this function into fmt-merge-msg.c so that
- related definitions can exist clearly in their own header file.
+ In builtin.h, there exists the distinctly "lib-ish" function
+ fmt_merge_msg(). This function can currently only be called by built-in
+ commands but, unlike most of the other functions in the header, it does
+ not make sense to impose this restriction as the functionality can be
+ logically reused in libgit.
+
+ Extract this function into fmt-merge-msg.c so that related definitions
+ can exist clearly in their own header file.

While we're at it, clean up #includes that are unused.

2: 249dbb9420 ! 2: c6a80ce882 Lib-ify prune-packed
@@ Commit message
Lib-ify prune-packed

In builtin.h, there exists the distinctly lib-ish function
- prune_packed_objects(). Extract this function into prune-packed.c so that
- related definitions can exist clearly in their own header file.
+ prune_packed_objects(). This function can currently only be called by
+ built-in commands but, unlike all of the other functions in the header,
+ it does not make sense to impose this restriction as the functionality
+ can be logically reused in libgit.
+
+ Extract this function into prune-packed.c so that related definitions
+ can exist clearly in their own header file.

While we're at it, clean up #includes that are unused.

Signature · 1 line
2.25.0.114.g5b0ca878e0