git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] log: respect log.shownotes variable

From
Jeff King <peff@peff.net>
Date
Apr 7, 2010, 20:45 UTC
Message-ID
<20100407204536.GA32382@coredump.intra.peff.net>

Log shows notes by default if no --pretty format is given. However, depending on what's in your default notes ref, that may actually be quite distracting when reading a normal log. Let's let the user decide whether they want to see notes by default.

Signed-off-by: Jeff King <peff@peff.net>
---
My git repository has your mailing list reference notes in
refs/notes/commits. They're quite bulky, and being headers, they look
kind of like a new commit stanza, which always confuses me when reading
log output. I got tired of typing --no-notes.

I guess an alternate solution would be for me to store them in some other ref, and then use --show-notes=email when I do want to see them (instead of just --show-notes, as I would do with this patch). But I still wonder if log.shownotes is a sensible addition, just for the sake of completeness.

 builtin/log.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 046f3e4..3d93607 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -24,6 +24,7 @@
 static const char *default_date_mode = NULL;
 
 static int default_show_root = 1;
+static int default_show_notes = 1;
 static int decoration_style;
 static const char *fmt_patch_subject_prefix = "PATCH";
 static const char *fmt_pretty;
@@ -77,7 +78,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 	argc = setup_revisions(argc, argv, rev, opt);
 
 	if (!rev->show_notes_given && !rev->pretty_given)
-		rev->show_notes = 1;
+		rev->show_notes = default_show_notes;
 	if (rev->show_notes)
 		init_display_notes(&rev->notes_opt);
 
@@ -291,6 +292,10 @@ static int git_log_config(const char *var, const char *value, void *cb)
 		default_show_root = git_config_bool(var, value);
 		return 0;
 	}
+	if (!strcmp(var, "log.shownotes")) {
+		default_show_notes = git_config_bool(var, value);
+		return 0;
+	}
 	return git_diff_ui_config(var, value, cb);
 }
 
-- 
1.7.1.rc0.220.g92be4.dirty
Next: Junio C Hamano
Message 1 of 8 in “log: respect log.shownotes variable”
  1. log: respect log.shownotes variableJeff King, Apr 7, 2010
  2. Junio C HamanoApr 7, 2010
  3. Michael J GruberApr 8, 2010
  4. Jeff KingApr 8, 2010
  5. Jeff KingApr 8, 2010
  6. Thomas RastApr 8, 2010
  7. Junio C HamanoApr 8, 2010
  8. Jeff KingApr 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.