{"thread":{"id":"58363","subject":"Considering add log.format and show.format configure option","startedAt":"2022-08-26T07:12:55Z","lastAt":"2022-08-26T16:42:34Z","messageCount":3,"participants":["Zang","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"461979","messageId":"CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw@mail.gmail.com","threadId":"58363","inReplyTo":null,"subject":"Considering add log.format and show.format configure option","fromName":"Zang","fromEmail":"zealot0630@gmail.com","sentAt":"2022-08-26T07:12:34Z","receivedAt":"2022-08-26T07:12:55Z","isPatch":false,"sender":{"key":"zealot0630@gmail.com","avatar":null},"body":"Hi forks,\n\nPeople including me are asking feature to use different format for log and show:\n\nhttps://stackoverflow.com/questions/20579889/different-pretty-formats-for-git-log-and-git-show\nhttps://stackoverflow.com/questions/37898232/make-different-pretty-settings-for-git-log-and-git-show\n\nCan we consider add such option to git-config\n\n[format]\n    mylogformat = <...>\n    myshowformat = <...>\n[log]\n    format = mylogformat\n[show]\n    format = myshowformat\n\nWhich should work same as\n\ngit log --format=mylogformat\ngit show --format=myshowformat\n"},{"id":"461984","messageId":"Ywh9LUOf9sNlVy4a@coredump.intra.peff.net","threadId":"58363","inReplyTo":"CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw@mail.gmail.com","subject":"Re: Considering add log.format and show.format configure option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2022-08-26T07:58:37Z","receivedAt":"2022-08-26T07:58:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Aug 26, 2022 at 03:12:34PM +0800, Zang wrote:\n\n> Can we consider add such option to git-config\n> \n> [format]\n>     mylogformat = <...>\n>     myshowformat = <...>\n> [log]\n>     format = mylogformat\n> [show]\n>     format = myshowformat\n> \n> Which should work same as\n> \n> git log --format=mylogformat\n> git show --format=myshowformat\n\nI don't think there is any reason not to add something like that. As you\nnote, we already allow overriding the default for all of the log-family\ncommands. So doing it for individual ones is not a stretch.\n\n(I'm not sure if you know, the first half of your suggestion is already\navailable as pretty.*, so this would just be adding log.format, etc, to\noverride format.pretty. Possibly your \"format' is just a typo of\n\"pretty\" there).\n\n-Peff\n"},{"id":"462003","messageId":"xmqqh71zyn16.fsf@gitster.g","threadId":"58363","inReplyTo":"CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw@mail.gmail.com","subject":"Re: Considering add log.format and show.format configure option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-08-26T16:42:13Z","receivedAt":"2022-08-26T16:42:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zang <zealot0630@gmail.com> writes:\n\n> Hi forks,\n>\n> People including me are asking feature to use different format for log and show:\n>\n> https://stackoverflow.com/q...\n\nWe do not pay attention to SO, and it is good you came here.\n\n> [log]\n>     format = mylogformat\n> [show]\n>     format = myshowformat\n\nI think something along this line was raised as a possible\nenhancement on the list earlier.  If we were to do so, we should not\nlimit the enhancement only to \"log/show\" but to all the commands in\nthe \"log\" family, and similarly, not only to \"format\", but to many\ncommon options.\n\nPatches welcome.\n\nThanks.\n\n"}]}