{"thread":{"id":"18386","subject":"Missing trailing newline with git log --pretty=format","startedAt":"2009-03-18T21:23:58Z","lastAt":"2009-03-18T22:27:39Z","messageCount":4,"participants":["Andreas Gruenbacher","Markus Heidelberg","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108427","messageId":"200903182223.58800.agruen@suse.de","threadId":"18386","inReplyTo":null,"subject":"Missing trailing newline with git log --pretty=format","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2009-03-18T21:23:58Z","receivedAt":"2009-03-18T21:23:58Z","isPatch":false,"sender":{"key":"agruen@suse.de","avatar":null},"body":"Hello,\n\nwith the latest version of git from right now (e986ceb):\n\nWhile trying to get a reverse list of commit ids, I noticed that git log \nprints newlines between commits, but not at the end. This results in two \njoined lines with:\n\n\t$ git log --pretty=format:%h HEAD^^..HEAD | tac\n\taab3b9a7d4e3a7\n\te986ceb\n\nAny chance of getting this fixed?\n\nThanks,\nAndreas\n"},{"id":"108442","messageId":"200903182256.43817.markus.heidelberg@web.de","threadId":"18386","inReplyTo":"200903182223.58800.agruen@suse.de","subject":"Re: Missing trailing newline with git log --pretty=format","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-03-18T21:56:43Z","receivedAt":"2009-03-18T21:56:43Z","isPatch":false,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Andreas Gruenbacher, 18.03.2009:\n> Hello,\n> \n> with the latest version of git from right now (e986ceb):\n> \n> While trying to get a reverse list of commit ids, I noticed that git log \n> prints newlines between commits, but not at the end. This results in two \n> joined lines with:\n> \n> \t$ git log --pretty=format:%h HEAD^^..HEAD | tac\n> \taab3b9a7d4e3a7\n> \te986ceb\n> \n> Any chance of getting this fixed?\n\nUse tformat instead of format. Or better for a script use\n\n\t$ git rev-list HEAD^^..HEAD\n\nBut somehow --abbrev or --abbrev-commit don't work. Am I doing\nsomething wrong?\n\nMarkus\n"},{"id":"108445","messageId":"200903182304.51387.agruen@suse.de","threadId":"18386","inReplyTo":"200903182256.43817.markus.heidelberg@web.de","subject":"Re: Missing trailing newline with git log --pretty=format","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2009-03-18T22:04:51Z","receivedAt":"2009-03-18T22:04:51Z","isPatch":false,"sender":{"key":"agruen@suse.de","avatar":null},"body":"On Wednesday, 18 March 2009 22:56:43 Markus Heidelberg wrote:\n> Use tformat instead of format.\n\nHmm ... didn't know that, thanks. Now I wonder why anyone would ever want \nformat instead of tformat ;)\n\n> Or better for a script use \n>\n> \t$ git rev-list HEAD^^..HEAD\n\nMuch better, thanks.\n\nAndreas\n"},{"id":"108447","messageId":"7vzlfibh5w.fsf@gitster.siamese.dyndns.org","threadId":"18386","inReplyTo":"200903182304.51387.agruen@suse.de","subject":"Re: Missing trailing newline with git log --pretty=format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-18T22:27:39Z","receivedAt":"2009-03-18T22:27:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Gruenbacher <agruen@suse.de> writes:\n\n> On Wednesday, 18 March 2009 22:56:43 Markus Heidelberg wrote:\n>> Use tformat instead of format.\n>\n> Hmm ... didn't know that, thanks. Now I wonder why anyone would ever want \n> format instead of tformat ;)\n\nIf your payload is multi-line, you would want to see a separating empty\nline in between entries, but not after the last one:\n\n\t$ command with --format\n        The first line of first entry.\n        The second line of first entry.\n        ...\n        The last line of first entry.\n\n        The first line of second entry.\n        ...\n        ...\n        The last line of last entry.\n        $ notice there is no extra newline after that\n\nThat is what --format does.  One-line-per-entry is a special case.  You do\nnot want a \"separating LF in between entries\", but a \"terminating LF after\neach entry\".  T in --tformat stands for this \"terminating\" aspect, as\nopposed to the \"separator\" behaviour --format gives you.\n"}]}