{"thread":{"id":"26578","subject":"Make \"terminator behavior\" the default with --pretty=format: ?","startedAt":"2011-02-22T15:43:56Z","lastAt":"2011-02-22T22:41:01Z","messageCount":4,"participants":["Hrvoje Nikšić","Will Palmer","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"161888","messageId":"AANLkTimFYsG3x0uGX32Ozo6C_shHd4k8jnXNhYmy7Q80@mail.gmail.com","threadId":"26578","inReplyTo":null,"subject":"Make \"terminator behavior\" the default with --pretty=format: ?","fromName":"Hrvoje Nikšić","fromEmail":"hniksic@gmail.com","sentAt":"2011-02-22T15:43:56Z","receivedAt":"2011-02-22T15:43:56Z","isPatch":false,"sender":{"key":"hniksic@gmail.com","avatar":"https://gravatar.com/avatar/a48579783560f9745ebcec8d2545f4f346ebad7a7dd58455536fc3263cfcea0a?d=mp&s=160"},"body":"Is there a reason, other than backward compatibility, for\n\"--prety=format:\" to have separator rather than terminator semantics?\n\nI got bitten by this badly today, because I was processing the output\nof git log --pretty=format:... through sh, like this:\n\n    git log --pretty=format:\"%H %an\" $old..$new | (\n        while read commit author; do\n           ... some processing ...\n        done\n    )\n\nIt turns out that the sh (which includes bash, dash, and zsh) \"read\"\nbuilt-in doesn't process lines that don't end in newline. The effect\nwas that the last line of output was silently ignored. It took some\nhours to track down.\n\nsh is not the only tool with this problem; many traditional Unix tools\ndon't process lines that don't end with newlines, and some require\nspecial exceptions and kludges (think diff). Because of this I believe\n\"format:\" should be changed to do terminator semantics, and tformat\ndeprecated. If this is not feasible, then the documentation should\nrecommend \"tformat:\", and only mention \"format\" as an afterthought,\nrather than the other way around.\n"},{"id":"161893","messageId":"1298393039.2286.14.camel@wpalmer.simply-domain","threadId":"26578","inReplyTo":"AANLkTimFYsG3x0uGX32Ozo6C_shHd4k8jnXNhYmy7Q80@mail.gmail.com","subject":"Re: Make \"terminator behavior\" the default with --pretty=format: ?","fromName":"Will Palmer","fromEmail":"wmpalmer@gmail.com","sentAt":"2011-02-22T16:43:59Z","receivedAt":"2011-02-22T16:43:59Z","isPatch":false,"sender":{"key":"wmpalmer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/357044?v=4"},"body":"On Tue, 2011-02-22 at 16:43 +0100, Hrvoje Nikšić wrote:\n> Is there a reason, other than backward compatibility, for\n> \"--prety=format:\" to have separator rather than terminator semantics?\n> \n\nThe \"default behaviour\" is the behaviour which occurs when one /doesn't/\nspecify something. For example: --pretty=\"%H %an\" uses terminator\nsemantics.\n\nI agree that --pretty=sformat: might be less ambiguous, though.\n"},{"id":"161895","messageId":"AANLkTikGYOdJNGNXR1egPyMBhKpT=bby5fmr8MR9QTXt@mail.gmail.com","threadId":"26578","inReplyTo":"1298393039.2286.14.camel@wpalmer.simply-domain","subject":"Re: Make \"terminator behavior\" the default with --pretty=format: ?","fromName":"Hrvoje Nikšić","fromEmail":"hniksic@gmail.com","sentAt":"2011-02-22T16:51:11Z","receivedAt":"2011-02-22T16:51:11Z","isPatch":false,"sender":{"key":"hniksic@gmail.com","avatar":"https://gravatar.com/avatar/a48579783560f9745ebcec8d2545f4f346ebad7a7dd58455536fc3263cfcea0a?d=mp&s=160"},"body":"On Tue, Feb 22, 2011 at 5:43 PM, Will Palmer <wmpalmer@gmail.com> wrote:\n> On Tue, 2011-02-22 at 16:43 +0100, Hrvoje Nikšić wrote:\n>> Is there a reason, other than backward compatibility, for\n>> \"--prety=format:\" to have separator rather than terminator semantics?\n>\n> The \"default behaviour\" is the behaviour which occurs when one /doesn't/\n> specify something. For example: --pretty=\"%H %an\" uses terminator\n> semantics.\n\nI didn't know that you could simply omit the \"format:\". Is it\ndocumented anywhere? The docs say:\n\n       --pretty[=<format>], --format[=<format>]\n           Pretty-print the contents of the commit logs in a given\nformat, where <format> can be one of oneline, short,\n           medium, full, fuller, email, raw and format:<string>. When\nomitted, the format defaults to medium.\n"},{"id":"161916","messageId":"AANLkTimLGqnxUygBUY6A=gpCa5gbT-g0L7ikW3Xbf+=_@mail.gmail.com","threadId":"26578","inReplyTo":"AANLkTikGYOdJNGNXR1egPyMBhKpT=bby5fmr8MR9QTXt@mail.gmail.com","subject":"Re: Make \"terminator behavior\" the default with --pretty=format: ?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-02-22T22:41:01Z","receivedAt":"2011-02-22T22:41:01Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Tue, Feb 22, 2011 at 11:51 AM, Hrvoje Nikšić <hniksic@gmail.com> wrote:\n> On Tue, Feb 22, 2011 at 5:43 PM, Will Palmer <wmpalmer@gmail.com> wrote:\n>> On Tue, 2011-02-22 at 16:43 +0100, Hrvoje Nikšić wrote:\n>>> Is there a reason, other than backward compatibility, for\n>>> \"--prety=format:\" to have separator rather than terminator semantics?\n>>\n>> The \"default behaviour\" is the behaviour which occurs when one /doesn't/\n>> specify something. For example: --pretty=\"%H %an\" uses terminator\n>> semantics.\n>\n> I didn't know that you could simply omit the \"format:\". Is it\n> documented anywhere? The docs say:\n>\n>       --pretty[=<format>], --format[=<format>]\n>           Pretty-print the contents of the commit logs in a given\n> format, where <format> can be one of oneline, short,\n>           medium, full, fuller, email, raw and format:<string>. When\n> omitted, the format defaults to medium.\n\nIn the tformat section is:\n\n \"In addition, any unrecognized string that has a % in it is\ninterpreted as if it has tformat: in front of it.\"\n\nOf course, you need to know to read that far into the man page to find\nthat sentence, and the earlier summary of --pretty never gives any\nhint to do so.\n\nMind submitting a documentation patch?\n\nj.\n"}]}