All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] log: respect log.shownotes variable
@ 2010-04-07 20:45 Jeff King
  2010-04-07 21:53 ` Junio C Hamano
  2010-04-08 16:12 ` Thomas Rast
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff King @ 2010-04-07 20:45 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Junio C Hamano, git

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-08 19:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-07 20:45 [PATCH] log: respect log.shownotes variable Jeff King
2010-04-07 21:53 ` Junio C Hamano
2010-04-08  2:01   ` Michael J Gruber
2010-04-08  7:07     ` Jeff King
2010-04-08  7:05   ` Jeff King
2010-04-08 16:12 ` Thomas Rast
2010-04-08 16:55   ` Junio C Hamano
2010-04-08 19:16   ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.