On 2017-01-10 15:14, Junio C Hamano wrote:
Richard Hansen <hansenr@xxxxxxxxxx> writes:
Document the format of the patterns used for the diff.orderFile
setting and diff's '-O' option by referring the reader to the
gitignore[5] page.
Signed-off-by: Richard Hansen <hansenr@xxxxxxxxxx>
---
Documentation/diff-config.txt | 3 ++-
Documentation/diff-options.txt | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
index 875212045..a35ecdd6b 100644
--- a/Documentation/diff-config.txt
+++ b/Documentation/diff-config.txt
@@ -100,7 +100,8 @@ diff.noprefix::
diff.orderFile::
File indicating how to order files within a diff, using
- one shell glob pattern per line.
+ one glob pattern per line.
+ See linkgit:gitignore[5] for the pattern format.
I do not think it is wise to suggest referring to gitignore, as the
logic of matching is quite different, other than the fact that they
both use wildmatch() internally. Also, unlike gitignore, orderfile
does not allow any negative matching i.e. "!<pattern>".
I was looking at the code to see how the two file formats differed and
noticed that match_order() doesn't set the WM_PATHNAME flag when it
calls wildmatch(). That's unintentional (a bug), right?
-Richard
If `diff.orderFile` is a relative pathname, it is treated as
relative to the top of the work tree.
Can be overridden by the '-O' option to linkgit:git-diff[1].
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index e6215c372..dc6b1af71 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -467,7 +467,8 @@ endif::git-format-patch[]
-O<orderfile>::
Output the patch in the order specified in the
- <orderfile>, which has one shell glob pattern per line.
+ <orderfile>, which has one glob pattern per line.
+ See linkgit:gitignore[5] for the pattern format.
This overrides the `diff.orderFile` configuration variable
(see linkgit:git-config[1]). To cancel `diff.orderFile`,
use `-O/dev/null`.