{"thread":{"id":"40360","subject":"\"Medium\" log format: change proposal for author != committer","startedAt":"2015-09-15T21:52:33Z","lastAt":"2015-09-16T22:25:32Z","messageCount":4,"participants":["Robin H. Johnson","Junio C Hamano","Jacob Keller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"270081","messageId":"robbat2-20150915T214920-375711965Z@orbis-terrarum.net","threadId":"40360","inReplyTo":null,"subject":"\"Medium\" log format: change proposal for author != committer","fromName":"Robin H. Johnson","fromEmail":"robbat2@gentoo.org","sentAt":"2015-09-15T21:52:33Z","receivedAt":"2015-09-15T21:52:33Z","isPatch":false,"sender":{"key":"robbat2@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/373898?v=4"},"body":"Hi,\n\nI want to propose a change to the 'medium' log output format, to improve\nreadability.\n\nSpecifically, if the author is NOT the same as the committer, then\ndisplay both in the header. Otherwise continue to display only the\nauthor.\n\nThis would aid quick review of changes in git-log & git-show output.\n\n-- \nRobin Hugh Johnson\nGentoo Linux: Developer, Infrastructure Lead\nE-Mail     : robbat2@gentoo.org\nGnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85\n"},{"id":"270091","messageId":"xmqq8u87t9jb.fsf@gitster.mtv.corp.google.com","threadId":"40360","inReplyTo":"robbat2-20150915T214920-375711965Z@orbis-terrarum.net","subject":"Re: \"Medium\" log format: change proposal for author != committer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-16T01:52:56Z","receivedAt":"2015-09-16T01:52:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Robin H. Johnson\" <robbat2@gentoo.org> writes:\n\n> Specifically, if the author is NOT the same as the committer, then\n> display both in the header. Otherwise continue to display only the\n> author.\n\nI too found myself wanting to see both of the names sometimes, and\nthe \"fuller\" format was added explicitly for that purpose.\n\nEven though I agree \"show only one, and both only when they are\ndifferent\" is a reasonable and possibly useful format, it is out of\nquestion to change what \"--pretty=medium\" does.  It has been with us\nforever and people and their scripts do rely on it.\n\nIt would be good if we can say\n\n    $ git log --pretty=robinsformat\n\nbut with a better name to show such an output.\n\n\nHaving said that, I'm moderately negative about adding it as yet\nanother hard-coded format.  We simply have too many, and we do not\nneed one more.  What we need instead is a flexible framework to let\nusers get what they want.\n\nI think what needs to happen is:\n\n * Enhance the \"--pretty=format:\" thing so that the current set of\n   hardcoded --pretty=medium,short,... formats and your modified\n   \"medium\" can be expressed as a custom format string.\n\n * Introduce a configuration mechanism to allow users to define new\n   short-hand, e.g. if you have this in your $HOME/.gitconfig:\n\n\t[pretty \"robin\"]\n        \tformat = \"commit %H%nAuthor: %an <%ae>%n...\"\n\n   and run \"git log --pretty=robin\", it would behave as if you said\n   \"git log --pretty=\"format:commit %H%nAuthor: %an <%ae>%n...\".\n\n * (optional) Replace the hardcoded implementations of pretty\n   formats with short-hand names like \"medium\", \"short\", etc. with a\n   built-in set of pretty.$name.format using the configuration\n   mechanism.  But we need to make sure this does not hurt\n   performance for common cases.\n"},{"id":"270101","messageId":"CA+P7+xqhJKGmxC=35bRvdKSj=nKRhfH9SqhR9ryrcBDknH-Y=w@mail.gmail.com","threadId":"40360","inReplyTo":"xmqq8u87t9jb.fsf@gitster.mtv.corp.google.com","subject":"Re: \"Medium\" log format: change proposal for author != committer","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-09-16T06:54:10Z","receivedAt":"2015-09-16T06:54:10Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Sep 15, 2015 at 6:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>  * Enhance the \"--pretty=format:\" thing so that the current set of\n>    hardcoded --pretty=medium,short,... formats and your modified\n>    \"medium\" can be expressed as a custom format string.\n>\n>  * Introduce a configuration mechanism to allow users to define new\n>    short-hand, e.g. if you have this in your $HOME/.gitconfig:\n>\n>         [pretty \"robin\"]\n>                 format = \"commit %H%nAuthor: %an <%ae>%n...\"\n>\n\nAfiak there is already support for this.. from \"git help config\":\n\npretty.<name>\nAlias for a --pretty= format string, as specified in git-log(1). Any\naliases defined here can be used just as the built-in pretty formats\ncould. For example, running git config pretty.changelog \"format:* %H\n%s\" would cause the invocation git log --pretty=changelog to be\nequivalent to running git log \"--pretty=format:* %H %s\". Note that an\nalias with the same name as a built-in format will be silently\nignored.\n\n>    and run \"git log --pretty=robin\", it would behave as if you said\n>    \"git log --pretty=\"format:commit %H%nAuthor: %an <%ae>%n...\".\n>\n\nSo this should already be supported... but to support \"robinsformat\"\nwe'd need to be able to \"show committer only if different from\nauthor\"... Not sure how that would work.\n\n>  * (optional) Replace the hardcoded implementations of pretty\n>    formats with short-hand names like \"medium\", \"short\", etc. with a\n>    built-in set of pretty.$name.format using the configuration\n>    mechanism.  But we need to make sure this does not hurt\n>    performance for common cases.\n>\n\nThis part obviously hasn't been done, I don't know if any particular\nformat is not expressable today by the pretty syntax or not..\n\nBut at least configuration does work. I use it as part of displaying the\n\nFixes: <sha1> (\"name\")\n\nused by the upstream kernel for marking bug fixes of known commits.\n\nThus the only real thing would be implementing a % modifier which\nallows showing commiter if it's not the same as author. (or vise\nversa) Ideally we could take work from the ref-filter library and the\nproposed \"%if\" stuff but I don't tihnk this was actually implemented\nyet, and I don't know if that would even work in the pretty modifiers.\n\nRegards,\nJake\n"},{"id":"270176","messageId":"xmqq4mium277.fsf@gitster.mtv.corp.google.com","threadId":"40360","inReplyTo":"CA+P7+xqhJKGmxC=35bRvdKSj=nKRhfH9SqhR9ryrcBDknH-Y=w@mail.gmail.com","subject":"Re: \"Medium\" log format: change proposal for author != committer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-16T22:25:32Z","receivedAt":"2015-09-16T22:25:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n> On Tue, Sep 15, 2015 at 6:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>>  * Enhance the \"--pretty=format:\" thing so that the current set of\n>>    hardcoded --pretty=medium,short,... formats and your modified\n>>    \"medium\" can be expressed as a custom format string.\n>>\n>>  * Introduce a configuration mechanism to allow users to define new\n>>    short-hand, e.g. if you have this in your $HOME/.gitconfig:\n>>\n>>         [pretty \"robin\"]\n>>                 format = \"commit %H%nAuthor: %an <%ae>%n...\"\n>>\n>\n> Afiak there is already support for this.. from \"git help config\":\n\nYup.  But before the first bullet item is done, it cannot be used to\nreplace the built-in hardcoded formats with a built-in set of default\nconfigurations.\n\n>>  * (optional) Replace the hardcoded implementations of pretty\n>>    formats with short-hand names like \"medium\", \"short\", etc. with a\n>>    built-in set of pretty.$name.format using the configuration\n>>    mechanism.  But we need to make sure this does not hurt\n>>    performance for common cases.\n>\n> This part obviously hasn't been done, I don't know if any particular\n> format is not expressable today by the pretty syntax or not..\n\nOne that we know we cannot is the nice conditional one Robin wants.\nI do think it is a reasonable thing to have.\n"}]}