{"thread":{"id":"11491","subject":"something like git-for-each-ref's --format for commits?","startedAt":"2008-01-06T08:52:21Z","lastAt":"2008-01-06T09:05:07Z","messageCount":2,"participants":["Brian Swetland","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"64578","messageId":"20080106085221.GA1729@bulgaria.corp.google.com","threadId":"11491","inReplyTo":null,"subject":"something like git-for-each-ref's --format for commits?","fromName":"Brian Swetland","fromEmail":"swetland@google.com","sentAt":"2008-01-06T08:52:21Z","receivedAt":"2008-01-06T08:52:21Z","isPatch":false,"sender":{"key":"swetland@google.com","avatar":"https://gravatar.com/avatar/b26b7c772097c55d8febb0fc027dd2ef577a05994a321819f49ab3c9153ac8b1?d=mp&s=160"},"body":"\nI'm trying to obtain various information about commits from a script.\nThe --format option to git-for-each-ref would be perfect, except that\nit only operates on refs, not arbitrary commit objects.\n\nThe --pretty=format:... option for git-log, etc has the annoying\nproperty of giving you <unknown> instead of an empty string if an\nitem isn't example (say if you use %b on a commit with no body).\n\nAm I missing some obvious solution here?  \n\nThanks,\n\nBrian\n"},{"id":"64579","messageId":"20080106090507.GA10965@coredump.intra.peff.net","threadId":"11491","inReplyTo":"20080106085221.GA1729@bulgaria.corp.google.com","subject":"Re: something like git-for-each-ref's --format for commits?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-06T09:05:07Z","receivedAt":"2008-01-06T09:05:07Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 06, 2008 at 12:52:21AM -0800, Brian Swetland wrote:\n\n> The --pretty=format:... option for git-log, etc has the annoying\n> property of giving you <unknown> instead of an empty string if an\n> item isn't example (say if you use %b on a commit with no body).\n> \n> Am I missing some obvious solution here?  \n\nI think --pretty=format: is what you are looking for. The \"<unknown>\"\nbehavior is fixed in the upcoming v1.5.4 (you get the empty string for\nyour example).\n\n-Peff\n"}]}