path: root/notes.h
diff options
authorDenton Liu <>2019-12-09 13:10:44 (GMT)
committerJunio C Hamano <>2019-12-09 21:36:45 (GMT)
commit452538c3586a76939faf43019fb7c21b3147309b (patch)
tree59871359eee629a5b38711cdb9feb6fc6a3b95f6 /notes.h
parente6e230eeae0f3cb46c4c356e6cd0a0f1119a2a83 (diff)
notes: extract logic into set_display_notes()
Instead of open coding the logic that tweaks the variables in `struct display_notes_opt` within handle_revision_opt(), abstract away the logic into set_display_notes() so that it can be reused. Signed-off-by: Denton Liu <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'notes.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/notes.h b/notes.h
index c0b7123..a476bfa 100644
--- a/notes.h
+++ b/notes.h
@@ -266,6 +266,16 @@ struct display_notes_opt {
void init_display_notes(struct display_notes_opt *opt);
+ * Set a display_notes_opt to a given state. 'show_notes' is a boolean
+ * representing whether or not to show notes. 'opt_ref' points to a
+ * string for the notes ref, or is NULL if the default notes should be
+ * used.
+ *
+ * Return 'show_notes' normalized to 1 or 0.
+ */
+int set_display_notes(struct display_notes_opt *opt, int show_notes, const char *opt_ref);
* Load the notes machinery for displaying several notes trees.
* If 'opt' is not NULL, then it specifies additional settings for the