Skip to content

Commit c006399

Browse files
committed
Merge branch 'ty/doc-diff-u-wo-number'
"git diff -U<num>" was too lenient in its command line parsing and took an empty string as a valid <num>. * ty/doc-diff-u-wo-number: diff: document -U without <n> as using default context
2 parents 8023abc + 4f6a803 commit c006399

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Documentation/diff-context-options.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
`-U<n>`::
22
`--unified=<n>`::
3-
Generate diffs with _<n>_ lines of context. Defaults to `diff.context`
4-
or 3 if the config option is unset.
3+
Generate diffs with _<n>_ lines of context. The number of context
4+
lines defaults to `diff.context` or 3 if the configuration variable
5+
is unset. (`-U` without `<n>` is silently accepted as a synonym for
6+
`-p` due to a historical accident).
57

68
`--inter-hunk-context=<n>`::
79
Show the context between diff hunks, up to the specified _<number>_

Documentation/diff-options.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ endif::git-log[]
127127

128128
`-U<n>`::
129129
`--unified=<n>`::
130-
Generate diffs with _<n>_ lines of context instead of
131-
the usual three.
130+
Generate diffs with _<n>_ lines of context. The number of context
131+
lines defaults to `diff.context` or 3 if the configuration variable
132+
is unset. (`-U` without `<n>` is silently accepted as a synonym for
133+
`-p` due to a historical accident).
132134
ifndef::git-format-patch[]
133135
Implies `--patch`.
134136
endif::git-format-patch[]

0 commit comments

Comments
 (0)