{"thread":{"id":"18783","subject":"Bug report - git show <tagname> together with --pretty=format","startedAt":"2009-04-08T12:56:39Z","lastAt":"2009-04-08T19:47:22Z","messageCount":4,"participants":["Cornelius","Michael J Gruber","Santi Béjar","Teemu Likonen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"110830","messageId":"49DC9F07.4090105@gmx.de","threadId":"18783","inReplyTo":null,"subject":"Bug report - git show <tagname> together with --pretty=format","fromName":"Cornelius","fromEmail":"c.r1@gmx.de","sentAt":"2009-04-08T12:56:39Z","receivedAt":"2009-04-08T12:56:39Z","isPatch":false,"sender":{"key":"c.r1@gmx.de","avatar":null},"body":"Hi,\nI've a problem with git 1.6.2.2 (self compiled) and git show. I use it's \noutput for parsing the git data, so this is more than a minor issue for \nme. When you normally do a git show on a tag name it's output resembles \nthe following:\ntag <tagname>\nTagger: Cornelius <c.r1@gmx.de>\nDate:   Wed Apr 8 14:39:17 2009 +0200\n\n\ntagmessage\ncommit 77e312e0527f87604e4c70ebf6040e79bb55d2ed\n<snip>\n\nNow when you do a git show <tagname> \n--pretty=format:\"ENDOFGITTAGOUTPUTMESAGEHERE%n%H\" --\nthe Date: line is missing. Git 1.6.0.5 (which is avaible in my distro's \nrepos) doesn't have this issue. Please CC me, I'm not subcribed here.\nCornelius\n"},{"id":"110834","messageId":"49DCC295.7010908@drmicha.warpmail.net","threadId":"18783","inReplyTo":"49DC9F07.4090105@gmx.de","subject":"Re: Bug report - git show <tagname> together with --pretty=format","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-04-08T15:28:21Z","receivedAt":"2009-04-08T15:28:21Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Cornelius venit, vidit, dixit 08.04.2009 14:56:\n> Hi,\n> I've a problem with git 1.6.2.2 (self compiled) and git show. I use it's \n> output for parsing the git data, so this is more than a minor issue for \n> me. When you normally do a git show on a tag name it's output resembles \n> the following:\n> tag <tagname>\n> Tagger: Cornelius <c.r1@gmx.de>\n> Date:   Wed Apr 8 14:39:17 2009 +0200\n> \n> \n> tagmessage\n> commit 77e312e0527f87604e4c70ebf6040e79bb55d2ed\n> <snip>\n> \n> Now when you do a git show <tagname> \n> --pretty=format:\"ENDOFGITTAGOUTPUTMESAGEHERE%n%H\" --\n> the Date: line is missing. Git 1.6.0.5 (which is avaible in my distro's \n> repos) doesn't have this issue. Please CC me, I'm not subcribed here.\n> Cornelius\n\nIt's not a bug, it's a feature ;)\n\nIn fact, git show used to ignore format specifiers for the tag part and\napply them to the commit part only. Since\nea718e6 (show <tag>: reuse pp_user_info() instead of duplicating code,\n2009-01-02)\n(which is in v1.6.2) it applies the format to both, which is why there\nis no tag date unless you ask for it (or use the default format).\n\nMichael\n"},{"id":"110844","messageId":"adf1fd3d0904080937v634c5b69rffa7a737f22a3768@mail.gmail.com","threadId":"18783","inReplyTo":"49DCC295.7010908@drmicha.warpmail.net","subject":"Re: Bug report - git show <tagname> together with --pretty=format","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-04-08T16:37:21Z","receivedAt":"2009-04-08T16:37:21Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2009/4/8 Michael J Gruber <git@drmicha.warpmail.net>:\n> Cornelius venit, vidit, dixit 08.04.2009 14:56:\n>> Hi,\n>> I've a problem with git 1.6.2.2 (self compiled) and git show. I use it's\n>> output for parsing the git data,\n\nIn addition to what Michael said, you should use the plumbing commands\ninstead of the porcelain (see man git). They are specifically for use\nwith scripts and parse their output. The output from the porcelain\ncommands can change.\n\nSanti\n"},{"id":"110864","messageId":"87myarszat.fsf_-_@iki.fi","threadId":"18783","inReplyTo":"adf1fd3d0904080937v634c5b69rffa7a737f22a3768@mail.gmail.com","subject":"Plumbing commands (was: Bug report - git show <tagname> together with --pretty=format)","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-04-08T19:47:22Z","receivedAt":"2009-04-08T19:47:22Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"On 2009-04-08 18:37 (+0200), Santi Béjar wrote:\n\n> In addition to what Michael said, you should use the plumbing commands\n> instead of the porcelain (see man git). They are specifically for use\n> with scripts and parse their output. The output from the porcelain\n> commands can change.\n\nHmm, I've been using a command like this in a script:\n\n    date=$(git log -1 --pretty=format:%ai $REV)\n\nWould it be better to change it to\n\n    date=$(git rev-list -1 --pretty=format:%ai $REV | sed -e 1d)\n\nor something else?\n"}]}