{"thread":{"id":"10884","subject":"[PATCH v2] Documentation: customize diff-options depending on particular command","startedAt":"2007-11-15T13:19:29Z","lastAt":"2007-11-15T13:19:29Z","messageCount":1,"participants":["Sergei Organov"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"59982","messageId":"87d4ub3a2o.fsf@osv.gnss.ru","threadId":"10884","inReplyTo":null,"subject":"[PATCH v2] Documentation: customize diff-options depending on particular command","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2007-11-15T13:19:29Z","receivedAt":"2007-11-15T13:19:29Z","isPatch":true,"sender":{"key":"osv@javad.com","avatar":null},"body":"Customize diff-options depending on particular command as follows,\nmostly to make git-diff and git-format-patch manuals less confusing:\n\n* git-format-patch:\n\n  - Mark --patch-with-stat as being the default.\n\n  - Change -p description so that it matches what it actually does and\n    so that it doesn't refer to absent \"section on generating\n    patches\".\n\n* git-diff: mark -p as being the default.\n\n* git-diff-index/git-diff-files/git-diff-tree: mark --raw as being\n  the default.\n\nSigned-off-by: Sergei Organov <osv@javad.com>\n---\n\nThis patch is very similar to v1, except that asciidoc bug is avoided\n(see comment in the first diff hunk).\n\n Documentation/diff-options.txt     |   24 +++++++++++++++++++++++-\n Documentation/git-diff.txt         |    1 +\n Documentation/git-format-patch.txt |    1 +\n 3 files changed, 25 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex b1f528a..e4af393 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -1,5 +1,25 @@\n+// Please don't remove this comment as asciidoc behaves badly when\n+// the first non-empty line is ifdef/ifndef. The symptom is that\n+// without this comment the <git-diff-core> attribute conditionally\n+// defined below ends up being defined unconditionally.\n+// Last checked with asciidoc 7.0.2.\n+\n+ifndef::git-format-patch[]\n+ifndef::git-diff[]\n+:git-diff-core: 1\n+endif::git-diff[]\n+endif::git-format-patch[]\n+\n+ifdef::git-format-patch[]\n -p::\n-\tGenerate patch (see section on generating patches)\n+\tGenerate patches without diffstat.\n+endif::git-format-patch[]\n+\n+ifndef::git-format-patch[]\n+-p::\n+\tGenerate patch (see section on generating patches).\n+\t{git-diff? This is the default.}\n+endif::git-format-patch[]\n \n -u::\n \tSynonym for \"-p\".\n@@ -13,6 +33,7 @@\n \n --raw::\n \tGenerate the raw format.\n+\t{git-diff-core? This is the default.}\n \n --patch-with-raw::\n \tSynonym for \"-p --raw\".\n@@ -41,6 +62,7 @@\n \n --patch-with-stat::\n \tSynonym for \"-p --stat\".\n+\t{git-format-patch? This is the default.}\n \n -z::\n \tNUL-line termination on output.  This affects the --raw\ndiff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt\nindex 11c4216..2808a5e 100644\n--- a/Documentation/git-diff.txt\n+++ b/Documentation/git-diff.txt\n@@ -75,6 +75,7 @@ and the range notations (\"<commit>..<commit>\" and\n \n OPTIONS\n -------\n+:git-diff: 1\n include::diff-options.txt[]\n \n <path>...::\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex f0617ef..268f227 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -65,6 +65,7 @@ reference.\n \n OPTIONS\n -------\n+:git-format-patch: 1\n include::diff-options.txt[]\n \n -<n>::\n-- \n1.5.3.4\n"}]}