{"thread":{"id":"14448","subject":"Re: [git pull] core/softirq for v2.6.27","startedAt":"2008-07-14T17:11:10Z","lastAt":"2008-07-14T18:08:52Z","messageCount":5,"participants":["Linus Torvalds","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"83274","messageId":"alpine.LFD.1.10.0807140948220.3305@woody.linux-foundation.org","threadId":"14448","inReplyTo":"20080714094422.e7ae255a.akpm@linux-foundation.org","subject":"Re: [git pull] core/softirq for v2.6.27","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-07-14T17:11:10Z","receivedAt":"2008-07-14T17:11:10Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 14 Jul 2008, Andrew Morton wrote:\n> \n> This was a git-shortlog feature request ;)\n\nHeh. You should cc git or Junio if so.\n\nThe way shortlog is done (very different from regular logs, due to the \nwhole organize-by-name etc thing) that is sadly pretty ugly to do: we \ndon't support the pretty-formats etc. And the way things are done, adding \nsupport for the generic \"--pretty=xyz\" (including custom formats) would be \npretty painful.\n\nSo it would have to be a total special-case.\n\nJunio, git people - what Andrew is asking for is for git shortlog to show \nthe commit ID (in shortened form) at the end:\n\n> > It would be nice if these short-form summaries were to include the\n> > commit IDs.  eg:\n> > \n> > Carlos R. Mafra (1):\n> >       Remove argument from open_softirq which is always NULL (962cf36)\n\nand I do think it would be nice. I've had some other things I would find \nshortlog format additions useful for (size of patch etc), so if it could \nbe somehow generalized that would be wonderful.\n\nAs it is, that is one ugly function that only takes the one-liner thing - \nat least partly because of how it traditionally worked (as a a filter over \nthe log messages, rather than as a \"git shortlog xyz..abc\" kind of \nstand-alone thing).\n\n\t\tLinus\n"},{"id":"83275","messageId":"alpine.LFD.1.10.0807141019010.3305@woody.linux-foundation.org","threadId":"14448","inReplyTo":"alpine.LFD.1.10.0807140948220.3305@woody.linux-foundation.org","subject":"Re: [git pull] core/softirq for v2.6.27","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-07-14T17:23:15Z","receivedAt":"2008-07-14T17:23:15Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 14 Jul 2008, Linus Torvalds wrote:\n> \n> As it is, that is one ugly function that only takes the one-liner thing - \n> at least partly because of how it traditionally worked (as a a filter over \n> the log messages, rather than as a \"git shortlog xyz..abc\" kind of \n> stand-alone thing).\n\nHeh. I guess you _could_ use the filter capability here (but it will \nsometimes truncate the line, so..)\n\nSome really ugly scripting like this will do it:\n\n\t#!/bin/sh\n\tgit log --pretty='format:commit %H\n\tAuthor: %an <%ae>\n\t\n\t  %s (%h)\n\t' $@ | git shortlog\n\nwhere we use the regular \"git log\" with a user-supplied format to generate \na log with the subject line and the shortened hash appended (the \"%s (%h)\" \npart) and then we use \"git shortlog\" as a filter to sort things together \nby author etc.\n\nThere is absolutely _nothing_ that git won't do with a little bit of \nscripting, but I do have to admit that this one isn't a wonderfully \nbeautiful script ;)\n\n\t\tLinus\n"},{"id":"83276","messageId":"alpine.DEB.1.00.0807141844160.8950@racer","threadId":"14448","inReplyTo":"alpine.LFD.1.10.0807141019010.3305@woody.linux-foundation.org","subject":"Re: [git pull] core/softirq for v2.6.27","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-14T17:46:15Z","receivedAt":"2008-07-14T17:46:15Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 14 Jul 2008, Linus Torvalds wrote:\n\n> \tgit log --pretty='format:commit %H\n> \tAuthor: %an <%ae>\n> \t\n> \t  %s (%h)\n> \t' $@ | git shortlog\n\nSurely you meant\n\n \tgit log --pretty='format:commit %H%nAuthor: %an <%ae>%n%n    %s (%h)' \\\n\t\t$@ | git shortlog\n\nNote that I do not think it would be all that hard to teach shortlog the \n--pretty option.\n\nCiao,\nDscho\n"},{"id":"83277","messageId":"alpine.LFD.1.10.0807141026200.3305@woody.linux-foundation.org","threadId":"14448","inReplyTo":"alpine.LFD.1.10.0807141019010.3305@woody.linux-foundation.org","subject":"Re: [git pull] core/softirq for v2.6.27","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-07-14T17:46:23Z","receivedAt":"2008-07-14T17:46:23Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 14 Jul 2008, Linus Torvalds wrote:\n> \n> Some really ugly scripting like this will do it:\n> \n> \t#!/bin/sh\n> \tgit log --pretty='format:commit %H\n> \tAuthor: %an <%ae>\n\nSide note: you can make it a one-liner with '%n' (not \\n') if you want, ie\n\n\t#!/bin/sh\n\tgit log --pretty='format:commit %H%nAuthor: %an <%ae>%n%n %s (%h)%n' $@ | git shortlog\n\nif you want to make it look even more like line noise.\n\nAnd if you want to be _really_ fancy, you can even make it a git \nalias. Just add somethign like this to your ~/.gitconfig file:\n\n\t[alias]\n\t\tmylog=!GIT_PAGER='git --no-pager shortlog' git log --pretty='format:commit %H%nAuthor: %an <%ae>%n%n %s (%h)%n'\n\nwhich is the _real_ git-mans way to do it.\n\nIt does the \"shortlog\" output by using \"git shortlog\" as a pager, but then \nto avoid recursion, we have to turn off paging of shortlog output itself. \nHeh. And the reason to do that is that the arguments always go to the end, \nso since we want to give the args to \"git log\", we can't put the pipe at \nthe end.\n\nI will have to go wash up after writing the above.\n\n\t\tLinus\n"},{"id":"83280","messageId":"alpine.DEB.1.00.0807141907590.8950@racer","threadId":"14448","inReplyTo":"alpine.DEB.1.00.0807141844160.8950@racer","subject":"[PATCH] shortlog: support --pretty=format: option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-14T18:08:52Z","receivedAt":"2008-07-14T18:08:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWith this patch, the user can override the default setting, to print\nthe commit messages using a user format instead of the onelines of the\ncommits.  Example:\n\n\t$ git shortlog --pretty='format:%s (%h)' <commit>..\n\nNote that shortlog will only respect a user format setting, as the other\nformats do not make much sense.\n\nWished for by Andrew Morton.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Mon, 14 Jul 2008, Johannes Schindelin wrote:\n\n\t> Note that I do not think it would be all that hard to teach \n\t> shortlog the --pretty option.\n\n\tWell...\n\n builtin-shortlog.c |   11 +++++++++++\n shortlog.h         |    1 +\n 2 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex 0136202..f8bcbfc 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -154,6 +154,15 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n \tif (!author)\n \t\tdie(\"Missing author: %s\",\n \t\t    sha1_to_hex(commit->object.sha1));\n+\tif (log->user_format) {\n+\t\tstruct strbuf buf = STRBUF_INIT;\n+\n+\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &buf,\n+\t\t\tDEFAULT_ABBREV, \"\", \"\", DATE_NORMAL, 0);\n+\t\tinsert_one_record(log, author, buf.buf);\n+\t\tstrbuf_release(&buf);\n+\t\treturn;\n+\t}\n \tif (*buffer)\n \t\tbuffer++;\n \tinsert_one_record(log, author, !*buffer ? \"<none>\" : buffer);\n@@ -271,6 +280,8 @@ parse_done:\n \t\tusage_with_options(shortlog_usage, options);\n \t}\n \n+\tlog.user_format = rev.commit_format == CMIT_FMT_USERFORMAT;\n+\n \t/* assume HEAD if from a tty */\n \tif (!nongit && !rev.pending.nr && isatty(0))\n \t\tadd_head_to_pending(&rev);\ndiff --git a/shortlog.h b/shortlog.h\nindex 31ff491..6608ee8 100644\n--- a/shortlog.h\n+++ b/shortlog.h\n@@ -11,6 +11,7 @@ struct shortlog {\n \tint wrap;\n \tint in1;\n \tint in2;\n+\tint user_format;\n \n \tchar *common_repo_prefix;\n \tint email;\n-- \n1.5.6.2.511.ge432a\n"}]}