{"thread":{"id":"52157","subject":"Fix and addition to git-diff","startedAt":"2019-10-30T09:16:00Z","lastAt":"2019-10-30T09:16:00Z","messageCount":1,"participants":["Олег Самойлов"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"385150","messageId":"232BC77E-F22E-469A-8839-6A1553A75B55@ya.ru","threadId":"52157","inReplyTo":null,"subject":"Fix and addition to git-diff","fromName":"Олег Самойлов","fromEmail":"splarv@ya.ru","sentAt":"2019-10-30T09:10:21Z","receivedAt":"2019-10-30T09:16:00Z","isPatch":false,"sender":{"key":"splarv@ya.ru","avatar":"https://gravatar.com/avatar/ce7491875e3929572ff03a05e4bb42e22e031d362ecaadf7d8c6b3f33b3218e6?d=mp&s=160"},"body":"Hi all.\n\nThis is a small patch with fix and addition to the man git-diff. This fix is obvious mistyping in man, there must be \"...\" instead of \"..\".\n\nAnd I added an example about how this can be used. The reason is:\n\nFirst, I don't know another reason to use a tree-ish with git diff. \nSecond, the diff with empty tree is a real problem on what some people looking for solution (for various reasons):\n\nhttps://stackoverflow.com/questions/14564034/creating-a-git-diff-from-nothing/54946189#54946189\nhttps://stackoverflow.com/questions/9765453/is-gits-semi-secret-empty-tree-object-reliable-and-why-is-there-not-a-symbolic/54945479#54945479\n\nAnd the solutions are not simple nor obvious. So I think it will be helpful to mention it.\n\n--- a/Documentation/git-diff.txt\n+++ b/Documentation/git-diff.txt\n@@ -77,8 +77,16 @@ two blob objects, or changes between two files on disk.\n\n Just in case you are doing something exotic, it should be\n noted that all of the <commit> in the above description, except\n-in the last two forms that use \"..\" notations, can be any\n-<tree>.\n+in the last form, that use the \"\\...\" notation, can be any\n+<tree>. For instance, if you want to make diffs against an empty\n+tree, you can create a tag pointing to the empty tree:\n+\n+'git tag' empty $('git hash-object' -t tree /dev/null)\n+\n+And use it for the 'git diff', for instance, to check a working tree\n+for whitespaces:\n+\n+'git diff' --check empty\n\n For a more complete list of ways to spell <commit>, see\n \"SPECIFYING REVISIONS\" section in linkgit:gitrevisions[7]."}]}