Skip to content

Commit

Permalink
Documentation: customize diff-options depending on particular command
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Sergei Organov authored and Junio C Hamano committed Nov 16, 2007
1 parent 8e7b07c commit c1a95fa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Documentation/diff-options.txt
Original file line number Diff line number Diff line change
@@ -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".
Expand All @@ -13,6 +33,7 @@

--raw::
Generate the raw format.
{git-diff-core? This is the default.}

--patch-with-raw::
Synonym for "-p --raw".
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Documentation/git-diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ and the range notations ("<commit>..<commit>" and

OPTIONS
-------
:git-diff: 1
include::diff-options.txt[]

<path>...::
Expand Down
1 change: 1 addition & 0 deletions Documentation/git-format-patch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ reference.

OPTIONS
-------
:git-format-patch: 1
include::diff-options.txt[]

-<n>::
Expand Down

0 comments on commit c1a95fa

Please sign in to comment.