git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: [PATCH] log: respect log.shownotes variable
Date: Wed, 7 Apr 2010 16:45:36 -0400	[thread overview]
Message-ID: <20100407204536.GA32382@coredump.intra.peff.net> (raw)

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

             reply	other threads:[~2010-04-07 20:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 20:45 Jeff King [this message]
2010-04-07 21:53 ` [PATCH] log: respect log.shownotes variable 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100407204536.GA32382@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).