{"thread":{"id":"61457","subject":"git shortlog --committer=name is documented, alas not implemented","startedAt":"2024-05-11T12:40:26Z","lastAt":"2024-05-11T16:17:41Z","messageCount":3,"participants":["Gerald Pfeifer","Georg Pfuetzenreuter","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"494536","messageId":"77e42d15-fcaf-5c1b-3a00-f1f1e3cedfc4@pfeifer.com","threadId":"61457","inReplyTo":null,"subject":"git shortlog --committer=name is documented, alas not implemented","fromName":"Gerald Pfeifer","fromEmail":"gerald@pfeifer.com","sentAt":"2024-05-11T12:34:12Z","receivedAt":"2024-05-11T12:40:26Z","isPatch":false,"sender":{"key":"gerald@pfeifer.com","avatar":null},"body":"`man git shortlog` (from git 2.45.0) has the following:\n\n   --author=<pattern>, --committer=<pattern>\n       Limit the commits output to ones with author/committer header lines \n       that match the specified pattern (regular expression). With more \n       than one --author=<pattern>, commits whose author matches any of \n       the given patterns are chosen (similarly for multiple \n       --committer=<pattern>).\n\nNow `git shortlog --author=gerald` works as expected.\n\nHowever `git shortlog --committer=gerald` results in an error:\n\n  error: option `committer' takes no value\n\nThis is either a doc bug or an implementation issue?\n\n\nAlso, how does one list all commits by a certain committer (as opposed \nto author) then?\n\n\nThanks,\nGerald\n"},{"id":"494537","messageId":"7c11e562-8476-4b0f-aadd-14695065b80e@syscid.com","threadId":"61457","inReplyTo":"77e42d15-fcaf-5c1b-3a00-f1f1e3cedfc4@pfeifer.com","subject":"Re: git shortlog --committer=name is documented, alas not implemented","fromName":"Georg Pfuetzenreuter","fromEmail":"georg@syscid.com","sentAt":"2024-05-11T13:12:26Z","receivedAt":"2024-05-11T13:19:10Z","isPatch":false,"sender":{"key":"georg@syscid.com","avatar":null},"body":"\n\nOn 5/11/24 14:34, Gerald Pfeifer wrote:\n> `man git shortlog` (from git 2.45.0) has the following:\n> \n>     --author=<pattern>, --committer=<pattern>\n>         Limit the commits output to ones with author/committer header lines\n>         that match the specified pattern (regular expression). With more\n>         than one --author=<pattern>, commits whose author matches any of\n>         the given patterns are chosen (similarly for multiple\n>         --committer=<pattern>).\n> \n> Now `git shortlog --author=gerald` works as expected.\n> \n> However `git shortlog --committer=gerald` results in an error:\n> \n>    error: option `committer' takes no value\n> \n> This is either a doc bug or an implementation issue?\n> \n> \n> Also, how does one list all commits by a certain committer (as opposed\n> to author) then?\n> \n> \n> Thanks,\n> Gerald\n> \n\nI think this is not implemented for shortlog, and the man page is \nconfusing. The --author=<pattern>/--committer=<pattern> section in \ngit-shortlog(1) (Documentation/git-shortlog.txt) is just included from \ngit-rev-list(1) (Documentation/rev-list-options.txt), but only the \n--committer argument documented in the \"parent\" git-shortlog.txt is valid.\n"},{"id":"494540","messageId":"xmqqfruo1fx9.fsf@gitster.g","threadId":"61457","inReplyTo":"77e42d15-fcaf-5c1b-3a00-f1f1e3cedfc4@pfeifer.com","subject":"Re: git shortlog --committer=name is documented, alas not implemented","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-05-11T16:17:38Z","receivedAt":"2024-05-11T16:17:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Gerald Pfeifer <gerald@pfeifer.com> writes:\n\n> `man git shortlog` (from git 2.45.0) has the following:\n>\n>    --author=<pattern>, --committer=<pattern>\n>        Limit the commits output to ones with author/committer header lines \n>        that match the specified pattern (regular expression). With more \n>        than one --author=<pattern>, commits whose author matches any of \n>        the given patterns are chosen (similarly for multiple \n>        --committer=<pattern>).\n>\n> Now `git shortlog --author=gerald` works as expected.\n>\n> However `git shortlog --committer=gerald` results in an error:\n>\n>   error: option `committer' takes no value\n>\n> This is either a doc bug or an implementation issue?\n\nIt is a UI and documentation issue.\n\nFor those who do not want to understand the underlying issue, a\nworkaround is to use the \"shortlog\" in the fitler mode, and use a\nseparate \"log\" as the commit selector, e.g.\n\n    $ git log --pretty=fuller --committer=gerald |\n      git shortlog [--committer] [-s] ...\n\nThe upstream of this pipeline finds only commits by gerald and shows\nthem with both Author: and Committer: header lines.  The downstream\nof this pipeline reads the \"log\" stream, and does the usual \"shortlog\"\nthing as a filter.\n\nThe \"--committer\" option of the \"shortlog\" command does not take a\nvalue; it is a boolean that tells the command \"I know you usually\ngroup commits by authors, but in this invocation I want you to group\nthem by committers\".  So if you have multiple \"--committer=<who>\"\nthings on the upstream \"git log\" side, you can sift these commits by\ncommitter on the downstream \"git shortlog\".\n\nNow for those who want to understand the underlying issue, the\n\"shortlog\" command works in two modes.  One is the filtering mode we\njust saw.  The other, which is more commonly used these days, is to\ninvoke the \"git log\" command that it reads from in the \"filtering\"\nmode internally.  Which means that \"shortlog\" command now needs to\nunderstand options and arguments for \"git log\" family of commands,\nlike\n\n - limiting the commits to a revision range, e.g.,\n   \"v2.44.0..v2.45.0\",\n\n - finding patterns in the commit object, e.g., \"--grep=<pattern>\"\n   and \"--author gerald\",\n\n - limiting the commits that touch specified paths, e.g.,\n   \"Documentation/\"\n\nas well as its own options, like \"-s\" \"-n\" \"--committer\", that\naffects how it summarizes the \"log\" stream.\n\nSo, now you see where one of the two problems you observed, i.e. the\nmanual page talks about --author=<who> and --committer=<who>\nlimiting, comes from.  It is because the documentation of the\n\"shortlog\" command tries to borrow from parts of the documentation\nof the \"log\" command.\n\nAnd the other one you observed is now easy to understand. As the\n\"shortlog\" needs \"--committer\" as a boolean \"are we grouping with\nthe committer?\", it thinks that you told it to do that but by\nmistake you added the option an unwanted value when you said\n\"--committer=gerald\".\n\nAn 80%-OK-fix may be to teach the command option parser of shortlog\nthat \"--committer\" (which it currently thinks is a strict boolean)\nis now an option that takes an optiona value, and when it is given\nwith a value, ignore it and pass it down to the underlying \"git log\".\nUnlike the real \"git log\" where you can say \"git log --committer gerald\",\nwith such a fix, you can only say \"git shortlog --committer=gerald\" (i.e.,\nyou are forced to use the \"--option=value\" form and \"--option value\" form\nis not allowed), but that may probably be OK.\n\nWith such a 80%-OK-fix, the documentation bug will disappear, which\nwould be a big plus ;-)\n\n"}]}