{"thread":{"id":"23375","subject":"[PATCH] log: respect log.shownotes variable","startedAt":"2010-04-07T20:45:36Z","lastAt":"2010-04-08T19:16:53Z","messageCount":8,"participants":["Jeff King","Junio C Hamano","Michael J Gruber","Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"138890","messageId":"20100407204536.GA32382@coredump.intra.peff.net","threadId":"23375","inReplyTo":null,"subject":"[PATCH] log: respect log.shownotes variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-04-07T20:45:36Z","receivedAt":"2010-04-07T20:45:36Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Log shows notes by default if no --pretty format is given.\nHowever, depending on what's in your default notes ref, that\nmay actually be quite distracting when reading a normal log.\nLet's let the user decide whether they want to see notes by\ndefault.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nMy git repository has your mailing list reference notes in\nrefs/notes/commits. They're quite bulky, and being headers, they look\nkind of like a new commit stanza, which always confuses me when reading\nlog output. I got tired of typing --no-notes.\n\nI guess an alternate solution would be for me to store them in some\nother ref, and then use --show-notes=email when I do want to see them\n(instead of just --show-notes, as I would do with this patch). But I\nstill wonder if log.shownotes is a sensible addition, just for the sake\nof completeness.\n\n builtin/log.c |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 046f3e4..3d93607 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -24,6 +24,7 @@\n static const char *default_date_mode = NULL;\n \n static int default_show_root = 1;\n+static int default_show_notes = 1;\n static int decoration_style;\n static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_pretty;\n@@ -77,7 +78,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \targc = setup_revisions(argc, argv, rev, opt);\n \n \tif (!rev->show_notes_given && !rev->pretty_given)\n-\t\trev->show_notes = 1;\n+\t\trev->show_notes = default_show_notes;\n \tif (rev->show_notes)\n \t\tinit_display_notes(&rev->notes_opt);\n \n@@ -291,6 +292,10 @@ static int git_log_config(const char *var, const char *value, void *cb)\n \t\tdefault_show_root = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"log.shownotes\")) {\n+\t\tdefault_show_notes = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n \treturn git_diff_ui_config(var, value, cb);\n }\n \n-- \n1.7.1.rc0.220.g92be4.dirty\n"},{"id":"138893","messageId":"7vljczapzt.fsf@alter.siamese.dyndns.org","threadId":"23375","inReplyTo":"20100407204536.GA32382@coredump.intra.peff.net","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-07T21:53:42Z","receivedAt":"2010-04-07T21:53:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I guess an alternate solution would be for me to store them in some\n> other ref, and then use --show-notes=email when I do want to see them\n> (instead of just --show-notes, as I would do with this patch). But I\n> still wonder if log.shownotes is a sensible addition, just for the sake\n> of completeness.\n\nMy gut feeling is that people who do have notes in the default namespace\n(or the ones in notes.displayRef) do want to see them _all the time_.\nOtherwise they'd put such notes in namespaces that are not shown by\ndefault, and view them on demand, no?\n\nBut then there is a bigger question: what kind of notes would you want to\nalways see as part of \"git log\" output?  My answer to that question for my\npersonal workflow (both dayjob and here) so far has been \"none\", and that\nis exactly the reason why my \"applied from this message\" notes live in\nnotes/am namespace and I have nothing in the default notes namespace.\n\nIf the answer is \"none\" for everybody, we should disable showing notes in\nany command unless the user explicitly asks with either the --show-notes\ncommand line option or the notes.displayRef and perhaps log.shownotes\nconfiguration variables.\n"},{"id":"138910","messageId":"4BBD390A.1030906@drmicha.warpmail.net","threadId":"23375","inReplyTo":"7vljczapzt.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-04-08T02:01:46Z","receivedAt":"2010-04-08T02:01:46Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 08.04.2010 05:53:\n> Jeff King <peff@peff.net> writes:\n> \n>> I guess an alternate solution would be for me to store them in some\n>> other ref, and then use --show-notes=email when I do want to see them\n>> (instead of just --show-notes, as I would do with this patch). But I\n>> still wonder if log.shownotes is a sensible addition, just for the sake\n>> of completeness.\n> \n> My gut feeling is that people who do have notes in the default namespace\n> (or the ones in notes.displayRef) do want to see them _all the time_.\n> Otherwise they'd put such notes in namespaces that are not shown by\n> default, and view them on demand, no?\n> \n> But then there is a bigger question: what kind of notes would you want to\n> always see as part of \"git log\" output?  My answer to that question for my\n> personal workflow (both dayjob and here) so far has been \"none\", and that\n> is exactly the reason why my \"applied from this message\" notes live in\n> notes/am namespace and I have nothing in the default notes namespace.\n> \n> If the answer is \"none\" for everybody, we should disable showing notes in\n> any command unless the user explicitly asks with either the --show-notes\n> command line option or the notes.displayRef and perhaps log.shownotes\n> configuration variables.\n\nPersonally, I like showing \"personal\" notes to patches by default. They\noften end up being the comments after the \"---\" in patch e-mails. All\nother notes (such as TR's) I keep in separate name spaces.\n\nBut I don't mind setting a(nother) config variable for that ;)\n\nBTW: I used to keep external notes in\nrefs/remotes/remotename/notes/notestree but since a while ago the notes\ncode insists on refs/notes/. In some sense it is similar to tags, where\nyou need to set up special refspecs if you want to have the remote\ntags/notes but don't want to mix them (and possibly have them conflict)\nwith your own. But I don't know a good strategy for making this more\nuser friendly.\n\nMichael\n"},{"id":"138943","messageId":"20100408070526.GH30473@coredump.intra.peff.net","threadId":"23375","inReplyTo":"7vljczapzt.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-04-08T07:05:26Z","receivedAt":"2010-04-08T07:05:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 07, 2010 at 02:53:42PM -0700, Junio C Hamano wrote:\n\n> My gut feeling is that people who do have notes in the default namespace\n> (or the ones in notes.displayRef) do want to see them _all the time_.\n> Otherwise they'd put such notes in namespaces that are not shown by\n> default, and view them on demand, no?\n\nI dunno. I don't have any notes I've written, so I just stuck Thomas' in\nrefs/notes/commit. In retrospect, that was probably dumb, because it\nconflicts with any notes I would write.\n\n> But then there is a bigger question: what kind of notes would you want to\n> always see as part of \"git log\" output?  My answer to that question for my\n> personal workflow (both dayjob and here) so far has been \"none\", and that\n> is exactly the reason why my \"applied from this message\" notes live in\n> notes/am namespace and I have nothing in the default notes namespace.\n\nYeah, thinking on it more, that is much better. I now have:\n\n  [remote \"trast\"]\n\t  url = git://repo.or.cz/git/trast.git\n\t  fetch = +refs/heads/notes/*:refs/notes/am/*\n\nwhich makes more sense (and I was happy to see he has kept updating\nthem. My copy was quite stale).\n\nSo let's ignore log.shownotes for now, and encourage people to manage\ntheir notes better. When we see more how people are using notes, we may\nwant it, but let's wait until then.\n\n-Peff\n"},{"id":"138945","messageId":"20100408070732.GI30473@coredump.intra.peff.net","threadId":"23375","inReplyTo":"4BBD390A.1030906@drmicha.warpmail.net","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-04-08T07:07:33Z","receivedAt":"2010-04-08T07:07:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 08, 2010 at 10:01:46AM +0800, Michael J Gruber wrote:\n\n> BTW: I used to keep external notes in\n> refs/remotes/remotename/notes/notestree but since a while ago the notes\n> code insists on refs/notes/. In some sense it is similar to tags, where\n> you need to set up special refspecs if you want to have the remote\n> tags/notes but don't want to mix them (and possibly have them conflict)\n> with your own. But I don't know a good strategy for making this more\n> user friendly.\n\nI always assumed that the \"prepend refs/notes\" magic would refuse to do\nso if the ref started with \"notes/\" (in which case it would append\n\"refs/\") or \"refs/\" (in which case it would append nothing). That is how\nwe handle some situations where a branch head or a remote could be\nused.\n\nBut I never checked, so maybe it doesn't. It probably should.\n\n-Peff\n"},{"id":"138964","messageId":"201004081812.50112.trast@student.ethz.ch","threadId":"23375","inReplyTo":"20100407204536.GA32382@coredump.intra.peff.net","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-04-08T16:12:49Z","receivedAt":"2010-04-08T16:12:49Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jeff King wrote:\n> Log shows notes by default if no --pretty format is given.\n> However, depending on what's in your default notes ref, that\n> may actually be quite distracting when reading a normal log.\n> Let's let the user decide whether they want to see notes by\n> default.\n\nLooks useful to me, and the patch looks obviously correct.\n\n> My git repository has your mailing list reference notes in\n> refs/notes/commits. They're quite bulky, and being headers, they look\n> kind of like a new commit stanza, which always confuses me when reading\n> log output. I got tired of typing --no-notes.\n> \n> I guess an alternate solution would be for me to store them in some\n> other ref, and then use --show-notes=email when I do want to see them\n> (instead of just --show-notes, as I would do with this patch). But I\n> still wonder if log.shownotes is a sensible addition, just for the sake\n> of completeness.\n\nI think it is a useful addition, *especially* in the case where the\nconfiguration departs from the default.  Typing --show-notes=email\n--show-notes=commits just to avoid showing a third set of notes in\nrefs/notes/bulky will get old fairly quickly...\n\nBTW, now that I seem to have a couple of users for those notes: what\nwould you like to see in the \"short\" version (notes/terse)?  Improving\nthat to be the \"common\" case has been on my todo list for quite some\ntime.  For example, I'm considering changing the 'permalink' to\n'thread' so that access to the full thread is easier (you'll still\nhave to click the subject to find the root).  Also, the message text\nsnippets have been broken since I revived it in February, does anyone\nmiss them?  They made the output even bulkier.\n\nOf course, I also hope that in the long run we can somehow generate\nthis from Junio's amlog for better accuracy :-)\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"138968","messageId":"7v39z57ujt.fsf@alter.siamese.dyndns.org","threadId":"23375","inReplyTo":"201004081812.50112.trast@student.ethz.ch","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-08T16:55:50Z","receivedAt":"2010-04-08T16:55:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> Looks useful to me, and the patch looks obviously correct.\n\nIt looked obviously correct and \"because we can\" not \"because we need\" to me.\n\n> I think it is a useful addition, *especially* in the case where the\n> configuration departs from the default.  Typing --show-notes=email\n> --show-notes=commits just to avoid showing a third set of notes in\n> refs/notes/bulky will get old fairly quickly...\n\nI initially thought so until I realized that notes.displayRef is already\nthere.  But you are the one who did 894a9d3 (Support showing notes from\nmore than one notes tree, 2010-03-12) to add that feature, so I suspect\nI forgot something while reaching my conclusion in [*1*].\n\n[reference]\n\n*1* Message-ID: <7vljczapzt.fsf@alter.siamese.dyndns.org>\n    $gmane/144286\n"},{"id":"138977","messageId":"20100408191653.GA14066@sigill.intra.peff.net","threadId":"23375","inReplyTo":"201004081812.50112.trast@student.ethz.ch","subject":"Re: [PATCH] log: respect log.shownotes variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-04-08T19:16:53Z","receivedAt":"2010-04-08T19:16:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 08, 2010 at 06:12:49PM +0200, Thomas Rast wrote:\n\n> BTW, now that I seem to have a couple of users for those notes: what\n> would you like to see in the \"short\" version (notes/terse)?  Improving\n\nFor me, the message-id is sufficient. I keep my own local archive of the\ngit list (because reading old threads in mutt is much nicer than on\ngmane), and it is trivial to convert message-id into whatever gmane link\nI want for referencing to other people.\n\n-Peff\n"}]}