{"thread":{"id":"13296","subject":"[PATCH] Documentation: More on --pretty with git-diff-tree","startedAt":"2008-04-27T17:40:42Z","lastAt":"2008-04-28T01:39:12Z","messageCount":4,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"75317","messageId":"200804271940.44940.jnareb@gmail.com","threadId":"13296","inReplyTo":null,"subject":"[PATCH] Documentation: More on --pretty with git-diff-tree","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-04-27T17:40:42Z","receivedAt":"2008-04-27T17:40:42Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Mention that --pretty=<format> option is used by git-diff-tree only\nif both --stdin and -v options are provided.  Because of that it doesn't\nmake sense to list pretty formats in git-diff-tree(1); linking to\ngit-show(1) should be enough.\n\nAbove changes appear only in git-diff-tree(1) manpage.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nI have stumbled upon this when trying to simplify generating\n'commitdiff_plain' view in gitweb.\n\n\"make doc\" compiles without errors, and produces expected result.\n\n Documentation/git-diff-tree.txt  |    6 +++++-\n Documentation/pretty-options.txt |    3 +++\n 2 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt\nindex 58d02c6..afe82e3 100644\n--- a/Documentation/git-diff-tree.txt\n+++ b/Documentation/git-diff-tree.txt\n@@ -24,6 +24,7 @@ Note that \"git-diff-tree\" can use the tree encapsulated in a commit object.\n \n OPTIONS\n -------\n+:git-diff-tree: 1\n include::diff-options.txt[]\n \n <tree-ish>::\n@@ -104,7 +105,10 @@ include::pretty-options.txt[]\n \tif the diff itself is empty.\n \n \n-include::pretty-formats.txt[]\n+Pretty Formats\n+--------------\n+\n+For description of pretty formats see for example linkgit:git-show[1]\n \n \n Limiting Output\ndiff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\nindex 6d66c74..8c101b9 100644\n--- a/Documentation/pretty-options.txt\n+++ b/Documentation/pretty-options.txt\n@@ -3,6 +3,9 @@\n \tPretty-print the contents of the commit logs in a given format,\n \twhere '<format>' can be one of 'oneline', 'short', 'medium',\n \t'full', 'fuller', 'email', 'raw' and 'format:<string>'.\n+ifdef::git-diff-tree[]\n+\tThis option is used for \"git-diff-tree --stdin -v\" combination.\n+endif::git-diff-tree[]\n \tWhen omitted, the format defaults to 'medium'.\n +\n Note: you can specify the default pretty format in the repository\n-- \n1.5.5\n"},{"id":"75332","messageId":"7vzlrfdmm4.fsf@gitster.siamese.dyndns.org","threadId":"13296","inReplyTo":"200804271940.44940.jnareb@gmail.com","subject":"Re: [PATCH] Documentation: More on --pretty with git-diff-tree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-27T21:16:51Z","receivedAt":"2008-04-27T21:16:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Mention that --pretty=<format> option is used by git-diff-tree only\n> if both --stdin and -v options are provided.\n\nInteresting.\n\n    $ git diff-tree --pretty=fuller --stat v1.5.5\n    commit 1d2375ddfee18bd3effd2c1f98527cc2f8b1df0a\n    Author:     Junio C Hamano <gitster@pobox.com>\n    AuthorDate: Mon Apr 7 21:57:43 2008 -0700\n    Commit:     Junio C Hamano <gitster@pobox.com>\n    CommitDate: Mon Apr 7 21:57:43 2008 -0700\n\n        GIT 1.5.5\n\n        Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n     Documentation/RelNotes-1.5.5.txt |    8 +-------\n     Documentation/git.txt            |    5 +++++\n     GIT-VERSION-GEN                  |    2 +-\n     3 files changed, 7 insertions(+), 8 deletions(-)\n\nAlso:\n\n    $ git rev-parse v1.5.5^0 | git diff-tree --pretty=short --dirstat --stdin\n    commit 1d2375ddfee18bd3effd2c1f98527cc2f8b1df0a\n    Author: Junio C Hamano <gitster@pobox.com>\n\n        GIT 1.5.5\n\n      89.2% Documentation/\n\nThere are two distinct uses for diff-tree, and by understanding it you\nwould be freed from the confusion.\n\n * You can compare two arbitrary tree-ish, and because a commit is a\n   tree-ish, comparing two commits is a special case of this.  There is no\n   reason to expect commit logs to be shown in such a use, and formatting\n   options would naturally be ineffective.\n\n * You can give a commit and ask the command to give difference ``for the\n   commit'', in other words, the diff between its parent and the given\n   commit.  --stdin is a special case to drive this mechanism repeatedly,\n   one commit at a time.  This is showing the diff as one of the\n   characteristic of the commit, and allowing to show other attributes of\n   the commit such as its message and timestamp makes sense, so formatting\n   options take effect.\n\n   As you can see from the above two examples, -v does not have much to do\n   with this.\n"},{"id":"75335","messageId":"200804280018.36470.jnareb@gmail.com","threadId":"13296","inReplyTo":"7vzlrfdmm4.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Documentation: More on --pretty with git-diff-tree","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-04-27T22:18:35Z","receivedAt":"2008-04-27T22:18:35Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n>> Mention that --pretty=<format> option is used by git-diff-tree only\n>> if both --stdin and -v options are provided.\n\n> There are two distinct uses for diff-tree, and by understanding it you\n> would be freed from the confusion.\n> \n>  * You can compare two arbitrary tree-ish, and because a commit is a\n>    tree-ish, comparing two commits is a special case of this.  There is no\n>    reason to expect commit logs to be shown in such a use, and formatting\n>    options would naturally be ineffective.\n> \n>  * You can give a commit and ask the command to give difference ``for the\n>    commit'', in other words, the diff between its parent and the given\n>    commit.  --stdin is a special case to drive this mechanism repeatedly,\n>    one commit at a time.  This is showing the diff as one of the\n>    characteristic of the commit, and allowing to show other attributes of\n>    the commit such as its message and timestamp makes sense, so formatting\n>    options take effect.\n\nSorry for the/my confusion.\n\nIt looks like gitweb's 'commitdiff' and 'commitdiff_plain' views\n(actions), both of which can take _two_ commits, needs to be rethough.\nCurrent output doesn't make much sense when the two commits in question\nare not parent and child.  Also, simplifying 'commitdiff_plain' by using\ngit-diff-tree with --pretty=email cannot work with current gitweb's\ncommitdiff features.\n\nBy the way, can one choose one of parents to be shown in ''for the\ncommit'' mode, or it is only combined (-c, --cc) or all (-m)?\n-- \nJakub Narebski\nPoland\n"},{"id":"75340","messageId":"7vlk2yep1b.fsf@gitster.siamese.dyndns.org","threadId":"13296","inReplyTo":"200804280018.36470.jnareb@gmail.com","subject":"Re: [PATCH] Documentation: More on --pretty with git-diff-tree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-28T01:39:12Z","receivedAt":"2008-04-28T01:39:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> By the way, can one choose one of parents to be shown in ''for the\n> commit'' mode, or it is only combined (-c, --cc) or all (-m)?\n\nNot without using \"diff $C^$N $C\", no, I do not think so, and that form\nwill be two-tree case so you won't get a log.\n\nWhen you treat all parents as equals, there is no good definition of a\nsingle patch for the commit for a merge.\n"}]}