@matheusbsbs / matheus-bagliano / commits / 1e6ed5441a
Fork 0

notes: rename to load_display_notes()

According to the function comment, init_display_notes() was supposed to "Load the notes machinery for displaying several notes trees." Rename this function to load_display_notes() so that its use is more accurately represented. This is done because, in a future commit, we will reuse the name init_display_notes(). Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Dec 9, 2019 at 05:10 UTC 1e6ed5441a61b5085978e0429691e2e2425f6846
3 files changed +6 -6
builtin/log.c
+2 -2
@@ -202,7 +202,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
202 if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
203 rev->show_notes = 1;
204 if (rev->show_notes)
205 - init_display_notes(&rev->notes_opt);
205 + load_display_notes(&rev->notes_opt);
206
207 if ((rev->diffopt.pickaxe_opts & DIFF_PICKAXE_KINDS_MASK) ||
208 rev->diffopt.filter || rev->diffopt.flags.follow_renames)
@@ -1749,7 +1749,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1749 rev.diffopt.flags.binary = 1;
1750
1751 if (rev.show_notes)
1752 - init_display_notes(&rev.notes_opt);
1752 + load_display_notes(&rev.notes_opt);
1753
1754 if (!output_directory && !use_stdout)
1755 output_directory = config_output_directory;
notes.c
+1 -1
@@ -1039,7 +1039,7 @@ struct notes_tree **load_notes_trees(struct string_list *refs, int flags)
1039 return trees;
1040 }
1041
1042 -void init_display_notes(struct display_notes_opt *opt)
1042 +void load_display_notes(struct display_notes_opt *opt)
1043 {
1044 char *display_ref_env;
1045 int load_config_refs = 0;
notes.h
+3 -3
@@ -272,18 +272,18 @@ struct display_notes_opt {
272 * - extra_notes_refs may contain a list of globs (in the same style
273 * as notes.displayRef) where notes should be loaded from.
274 */
275 -void init_display_notes(struct display_notes_opt *opt);
275 +void load_display_notes(struct display_notes_opt *opt);
276
277 /*
278 * Append notes for the given 'object_sha1' from all trees set up by
279 - * init_display_notes() to 'sb'. The 'flags' are a bitwise
279 + * load_display_notes() to 'sb'. The 'flags' are a bitwise
280 * combination of
281 *
282 * - NOTES_SHOW_HEADER: add a 'Notes (refname):' header
283 *
284 * - NOTES_INDENT: indent the notes by 4 places
285 *
286 - * You *must* call init_display_notes() before using this function.
286 + * You *must* call load_display_notes() before using this function.
287 */
288 void format_display_notes(const struct object_id *object_oid,
289 struct strbuf *sb, const char *output_encoding, int raw);