Skip to content

Commit ce6521e

Browse files
Denton-Lgitster
authored andcommitted
Lib-ify fmt-merge-msg
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. This patch is best viewed with --color-moved. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 274b9cc commit ce6521e

File tree

5 files changed

+668
-665
lines changed

5 files changed

+668
-665
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ LIB_OBJS += ewah/ewah_rlw.o
886886
LIB_OBJS += exec-cmd.o
887887
LIB_OBJS += fetch-negotiator.o
888888
LIB_OBJS += fetch-pack.o
889+
LIB_OBJS += fmt-merge-msg.o
889890
LIB_OBJS += fsck.o
890891
LIB_OBJS += fsmonitor.o
891892
LIB_OBJS += gettext.o

builtin.h

-11
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@
9494
* command.
9595
*/
9696

97-
#define DEFAULT_MERGE_LOG_LEN 20
98-
9997
extern const char git_usage_string[];
10098
extern const char git_more_info_string[];
10199

@@ -104,15 +102,6 @@ extern const char git_more_info_string[];
104102

105103
void prune_packed_objects(int);
106104

107-
struct fmt_merge_msg_opts {
108-
unsigned add_title:1,
109-
credit_people:1;
110-
int shortlog_len;
111-
};
112-
113-
int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
114-
struct fmt_merge_msg_opts *);
115-
116105
/**
117106
* If a built-in has DELAY_PAGER_CONFIG set, the built-in should call this early
118107
* when it wishes to respect the `pager.foo`-config. The `cmd` is the name of

0 commit comments

Comments
 (0)