All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Organov <osv@javad.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH v2] Documentation: customize diff-options depending on particular command
Date: Thu, 15 Nov 2007 16:19:29 +0300	[thread overview]
Message-ID: <87d4ub3a2o.fsf@osv.gnss.ru> (raw)

Customize diff-options depending on particular command as follows,
mostly to make git-diff and git-format-patch manuals less confusing:

* git-format-patch:

  - Mark --patch-with-stat as being the default.

  - Change -p description so that it matches what it actually does and
    so that it doesn't refer to absent "section on generating
    patches".

* git-diff: mark -p as being the default.

* git-diff-index/git-diff-files/git-diff-tree: mark --raw as being
  the default.

Signed-off-by: Sergei Organov <osv@javad.com>
---

This patch is very similar to v1, except that asciidoc bug is avoided
(see comment in the first diff hunk).

 Documentation/diff-options.txt     |   24 +++++++++++++++++++++++-
 Documentation/git-diff.txt         |    1 +
 Documentation/git-format-patch.txt |    1 +
 3 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index b1f528a..e4af393 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -1,5 +1,25 @@
+// Please don't remove this comment as asciidoc behaves badly when
+// the first non-empty line is ifdef/ifndef. The symptom is that
+// without this comment the <git-diff-core> attribute conditionally
+// defined below ends up being defined unconditionally.
+// Last checked with asciidoc 7.0.2.
+
+ifndef::git-format-patch[]
+ifndef::git-diff[]
+:git-diff-core: 1
+endif::git-diff[]
+endif::git-format-patch[]
+
+ifdef::git-format-patch[]
 -p::
-	Generate patch (see section on generating patches)
+	Generate patches without diffstat.
+endif::git-format-patch[]
+
+ifndef::git-format-patch[]
+-p::
+	Generate patch (see section on generating patches).
+	{git-diff? This is the default.}
+endif::git-format-patch[]
 
 -u::
 	Synonym for "-p".
@@ -13,6 +33,7 @@
 
 --raw::
 	Generate the raw format.
+	{git-diff-core? This is the default.}
 
 --patch-with-raw::
 	Synonym for "-p --raw".
@@ -41,6 +62,7 @@
 
 --patch-with-stat::
 	Synonym for "-p --stat".
+	{git-format-patch? This is the default.}
 
 -z::
 	NUL-line termination on output.  This affects the --raw
diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 11c4216..2808a5e 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -75,6 +75,7 @@ and the range notations ("<commit>..<commit>" and
 
 OPTIONS
 -------
+:git-diff: 1
 include::diff-options.txt[]
 
 <path>...::
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index f0617ef..268f227 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -65,6 +65,7 @@ reference.
 
 OPTIONS
 -------
+:git-format-patch: 1
 include::diff-options.txt[]
 
 -<n>::
-- 
1.5.3.4

                 reply	other threads:[~2007-11-15 13:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d4ub3a2o.fsf@osv.gnss.ru \
    --to=osv@javad.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.