Skip to contentSkip to conversation

doc/diff-options: fix out of place mentions of '--patch/-p'

PATCH In review Sergey Organov 2 participants 2 messages Oct 31, 2020 – Nov 2, 2020 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc/diff-options: fix out of place mentions of '--patch/-p'

First, references to --patch and -p appeared in the description of git-format-patch, where the options themselves are not included.

Next, the description of --unified option elsewhere had duplicate implied
statements: "Implies --patch. Implies -p."

---
 Documentation/diff-options.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/diff-options.txt +6 -3
index 573fb9bb71e2..320304033483 100644
@@ -36,9 +36,9 @@ endif::git-format-patch[]
 -U<n>::
 --unified=<n>::
 	Generate diffs with <n> lines of context instead of
-	the usual three. Implies `--patch`.
+	the usual three.
 ifndef::git-format-patch[]
-	Implies `-p`.
+	Implies `--patch`.
 endif::git-format-patch[]
 
 --output=<file>::
@@ -441,7 +441,10 @@ endif::git-format-patch[]
 
 --binary::
 	In addition to `--full-index`, output a binary diff that
-	can be applied with `git-apply`. Implies `--patch`.
+	can be applied with `git-apply`.
+ifndef::git-format-patch[]
+	Implies `--patch`.
+endif::git-format-patch[]
 
 --abbrev[=<n>]::
 	Instead of showing the full 40-byte hexadecimal object
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · Sergey Organov

First, references to --patch and -p appeared in the description of git-format-patch, where the options themselves are not included.

Fun. The -U<n> option in "git diff-index -U9" implicitly turns "--patch" on, but it is hard to say that the same option in "git format-patch -U9" turns "--patch" on, as it is in effect even without the -U<n> option.

It makes readers wonder what, if anything, needs to be done for "git diff -U9", but let's leave it out of the scope of this change, which is strict improvement for "format-patch" documentation.

Thanks.

Quoted 36 lines

Next, the description of --unified option elsewhere had duplicate implied
statements: "Implies --patch. Implies -p."

---
 Documentation/diff-options.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/diff-options.txt +6 -3
index 573fb9bb71e2..320304033483 100644
@@ -36,9 +36,9 @@ endif::git-format-patch[]
 -U<n>::
 --unified=<n>::
 	Generate diffs with <n> lines of context instead of
-	the usual three. Implies `--patch`.
+	the usual three.
 ifndef::git-format-patch[]
-	Implies `-p`.
+	Implies `--patch`.
 endif::git-format-patch[]
 
 --output=<file>::
@@ -441,7 +441,10 @@ endif::git-format-patch[]
 
 --binary::
 	In addition to `--full-index`, output a binary diff that
-	can be applied with `git-apply`. Implies `--patch`.
+	can be applied with `git-apply`.
+ifndef::git-format-patch[]
+	Implies `--patch`.
+endif::git-format-patch[]
 
 --abbrev[=<n>]::
 	Instead of showing the full 40-byte hexadecimal object