From 1a5fccc0c26b4a8abafd85a73558022e65f6f8cf Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 15 Jan 2017 17:16:30 -0500 Subject: diff: document behavior of relative diff.orderFile Document that a relative pathname for diff.orderFile is interpreted as relative to the top-level work directory. Signed-off-by: Richard Hansen Signed-off-by: Junio C Hamano diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt index 58f4bd6..bf95585 100644 --- a/Documentation/diff-config.txt +++ b/Documentation/diff-config.txt @@ -101,6 +101,8 @@ diff.noprefix:: diff.orderFile:: File indicating how to order files within a diff, using one shell glob pattern per line. + If `diff.orderFile` is a relative pathname, it is treated as + relative to the top of the working tree. Can be overridden by the '-O' option to linkgit:git-diff[1]. diff.renameLimit:: -- cgit v0.10.2-6-g49f6 From 874444b70451879d5b9b7e288e5c4e711c4a87ac Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 15 Jan 2017 17:16:31 -0500 Subject: diff: document the format of the -O (diff.orderFile) file Signed-off-by: Richard Hansen Signed-off-by: Junio C Hamano diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt index bf95585..85aca8b 100644 --- a/Documentation/diff-config.txt +++ b/Documentation/diff-config.txt @@ -99,11 +99,10 @@ diff.noprefix:: If set, 'git diff' does not show any source or destination prefix. diff.orderFile:: - File indicating how to order files within a diff, using - one shell glob pattern per line. + File indicating how to order files within a diff. + See the '-O' option to linkgit:git-diff[1] for details. If `diff.orderFile` is a relative pathname, it is treated as relative to the top of the working tree. - Can be overridden by the '-O' option to linkgit:git-diff[1]. diff.renameLimit:: The number of files to consider when performing the copy/rename diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index e6215c3..d4fb707 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -466,11 +466,41 @@ information. endif::git-format-patch[] -O:: - Output the patch in the order specified in the - , which has one shell glob pattern per line. + Control the order in which files appear in the output. This overrides the `diff.orderFile` configuration variable (see linkgit:git-config[1]). To cancel `diff.orderFile`, use `-O/dev/null`. ++ +The output order is determined by the order of glob patterns in +. +All files with pathnames that match the first pattern are output +first, all files with pathnames that match the second pattern (but not +the first) are output next, and so on. +All files with pathnames that do not match any pattern are output +last, as if there was an implicit match-all pattern at the end of the +file. +If multiple pathnames have the same rank (they match the same pattern +but no earlier patterns), their output order relative to each other is +the normal order. ++ + is parsed as follows: ++ +-- + - Blank lines are ignored, so they can be used as separators for + readability. + + - Lines starting with a hash ("`#`") are ignored, so they can be used + for comments. Add a backslash ("`\`") to the beginning of the + pattern if it starts with a hash. + + - Each other line contains a single pattern. +-- ++ +Patterns have the same syntax and semantics as patterns used for +fnmantch(3) without the FNM_PATHNAME flag, except a pathname also +matches a pattern if removing any number of the final pathname +components matches the pattern. For example, the pattern "`foo*bar`" +matches "`fooasdfbar`" and "`foo/bar/baz/asdf`" but not "`foobarx`". ifndef::git-format-patch[] -R:: -- cgit v0.10.2-6-g49f6