{"thread":{"id":"52311","subject":"git-log diff formatting options: some turn on diffs, some don't","startedAt":"2019-11-22T11:43:06Z","lastAt":"2019-11-25T10:47:41Z","messageCount":3,"participants":["Ed Avis","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"386816","messageId":"55ab4d09c51446c6b23abbb1c92441d6@WCL-EX13MBX-DR.wcl.local","threadId":"52311","inReplyTo":null,"subject":"git-log diff formatting options: some turn on diffs, some don't","fromName":"Ed Avis","fromEmail":"eda@waniasset.com","sentAt":"2019-11-22T11:42:58Z","receivedAt":"2019-11-22T11:43:06Z","isPatch":false,"sender":{"key":"eda@waniasset.com","avatar":null},"body":"If you run git log -c this implies the -p flag.  But git log -r does not imply -p, even though both -r and -c are flags which exist to 'control the formatting of diff output' according to the documentation.\n\nI think that all the flags listed in that section should implicitly turn on -p if it wasn't given.  (I'd also be content if they died with an error when -p wasn't given, but that could break existing users.)  The current behaviour is inconsistent and a bit of a headscratcher when 'git log -r' produces the same output as plain 'git log'.\n\n\nTo learn how we protect privacy, please use this link (https://www.qma.com/gdpr.html) to read our Privacy Notice.\n\nThis email and any files transmitted with it are CONFIDENTIAL and are intended solely for the use of the individual(s) or entity to whom they are addressed. Any unauthorised copying, disclosure or distribution of the material within this email is strictly forbidden. Any views or opinions presented within this email are solely those of the author and do not necessarily represent those of QMA Wadhwani (QMAW) unless otherwise specifically stated. An electronic message is not binding on its sender. Any message referring to a binding agreement must be confirmed in writing and duly signed. If you have received this email in error, please notify the sender immediately and delete the original. Telephone, electronic and other communications and conversations with QMAW and/or its associated persons may be recorded and retained.\n\nPlease note that your personal information may be stored and processed in any country where we have facilities or in which we engage service providers. If you provide personal information to us by email or otherwise, you consent to the transfer of that information to countries outside of your country of residence and these countries may have different data protection rules than your country.\n\n"},{"id":"386892","messageId":"xmqq1rtz2v99.fsf@gitster-ct.c.googlers.com","threadId":"52311","inReplyTo":"55ab4d09c51446c6b23abbb1c92441d6@WCL-EX13MBX-DR.wcl.local","subject":"Re: git-log diff formatting options: some turn on diffs, some don't","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-11-23T02:15:30Z","receivedAt":"2019-11-23T02:17:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ed Avis <eda@waniasset.com> writes:\n\n> If you run git log -c this implies the -p flag.  But git log -r\n> does not imply -p, even though both -r and -c are flags which\n> exist to 'control the formatting of diff output' according to the\n> documentation.\n\n`-r` does not control the formatting, actually.  It has no effect in\nthe Porcelain \"git diff\" and \"git log\"---it is always on and there\nmay not even be a way to turn it off (so, effectively it is a no-op).\n\nThe only case I offhand recall that `-r` makes difference is when\nrunning `git diff-tree`, whose default output format is the `--raw`\nformat.  `git diff-tree A B` and `git diff-tree -r A B` both give\nits output in the raw format, but if there are differences in the\ncontents of the subdirectory between A and B, the former just shows\nthe subdirectory without showing which paths in that subdirectory\ndiffer, while the latter shows the individual paths.  For obvious\nreasons, the '-r' option must *not* imply '-p' for this command, to\nwhich the `-r` option has any effect.\n\nI've responded to your email even though I wasn't the entity to whom\nit was addressed.  I promise I won't do so again ;-)\n\n> To learn how we protect privacy, please use this link (https://www.qma.com/gdpr.html) to read our Privacy Notice.\n>\n> This email and any files transmitted with it are CONFIDENTIAL and are intended solely for the use of the individual(s) or entity to whom they are addressed. Any unauthorised copying, disclosure or distribution of the material within this email is strictly forbidden. Any views or opinions presented within this email are solely those of the author and do not necessarily represent those of QMA Wadhwani (QMAW) unless otherwise specifically stated. An electronic message is not binding on its sender. Any message referring to a binding agreement must be confirmed in writing and duly signed. If you have received this email in error, please notify the sender immediately and delete the original. Telephone, electronic and other communications and conversations with QMAW and/or its associated persons may be recorded and retained.\n>\n> Please note that your personal information may be stored and processed in any country where we have facilities or in which we engage service providers. If you provide personal information to us by email or otherwise, you consent to the transfer of that information to countries outside of your country of residence and these countries may have different data protection rules than your country.\n\n"},{"id":"386981","messageId":"cbfdbe62ad394abe9222c6e4d7875651@WCL-EX13MBX-DR.wcl.local","threadId":"52311","inReplyTo":"xmqq1rtz2v99.fsf@gitster-ct.c.googlers.com","subject":"RE: git-log diff formatting options: some turn on diffs, some don't","fromName":"Ed Avis","fromEmail":"eda@waniasset.com","sentAt":"2019-11-25T10:46:55Z","receivedAt":"2019-11-25T10:47:41Z","isPatch":false,"sender":{"key":"eda@waniasset.com","avatar":null},"body":"Thanks for your reply.  If the -r flag has no effect on 'git log' then shouldn't it be omitted from the documentation?\nhttps://git-scm.com/docs/git-log has a section on 'Diff Formatting' but if I understand you rightly, a large part of that only applies to other commands.\n\nFurther, I would suggest that if the -r flag does get passed to 'git log' then it should give a warning.\n(Ideally I would say an error, but there might be existing scripts that pass it.)\n\n\nTo learn how we protect privacy, please use this link (https://www.qma.com/gdpr.html) to read our Privacy Notice.\n\nThis email and any files transmitted with it are CONFIDENTIAL and are intended solely for the use of the individual(s) or entity to whom they are addressed. Any unauthorised copying, disclosure or distribution of the material within this email is strictly forbidden. Any views or opinions presented within this email are solely those of the author and do not necessarily represent those of QMA Wadhwani (QMAW) unless otherwise specifically stated. An electronic message is not binding on its sender. Any message referring to a binding agreement must be confirmed in writing and duly signed. If you have received this email in error, please notify the sender immediately and delete the original. Telephone, electronic and other communications and conversations with QMAW and/or its associated persons may be recorded and retained.\n\nPlease note that your personal information may be stored and processed in any country where we have facilities or in which we engage service providers. If you provide personal information to us by email or otherwise, you consent to the transfer of that information to countries outside of your country of residence and these countries may have different data protection rules than your country.\n\n"}]}