I am ready to take the blame for being the first to introduce
--detect-* options in diff-opts, with the directory-rename stuff.
However, since --find-copies-harder predates everything and is the
only one to be part of a release today, I'd think it would be much
more consistent to use --find- as a common prefix. And, last but not
least, shorter long options do not hurt.
At the same time, I noticed the manpage could benefit from a small
improvement.
@@ -230,7 +230,7 @@ eligible for being picked up as a possible source of a rename to another file. -M[<n>]::---detect-renames[=<n>]::+--find-renames[=<n>]:: ifndef::git-log[] Detect renames. endif::git-log[]
@@ -246,7 +246,7 @@ endif::git-log[] hasn't changed. -C[<n>]::---detect-copies[=<n>]::+--find-copies[=<n>]:: Detect copies as well as renames. See also `--find-copies-harder`. If `n` is specified, it has the same meaning as for `-M<n>`.
It makes little sense to have --diff-filter in the middle of them, and
even spares an ifndef::git-format-patch.
Signed-off-by: Yann Dirson <redacted>
---
Documentation/diff-options.txt | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
@@ -250,20 +250,6 @@ endif::git-log[] Detect copies as well as renames. See also `--find-copies-harder`. If `n` is specified, it has the same meaning as for `-M<n>`.-ifndef::git-format-patch[]---diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::- Select only files that are Added (`A`), Copied (`C`),- Deleted (`D`), Modified (`M`), Renamed (`R`), have their- type (i.e. regular file, symlink, submodule, ...) changed (`T`),- are Unmerged (`U`), are- Unknown (`X`), or have had their pairing Broken (`B`).- Any combination of the filter characters (including none) can be used.- When `*` (All-or-none) is added to the combination, all- paths are selected if there is any file that matches- other criteria in the comparison; if there is no file- that matches other criteria, nothing is selected.-endif::git-format-patch[]- --find-copies-harder:: For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same
@@ -281,6 +267,18 @@ endif::git-format-patch[] number. ifndef::git-format-patch[]+--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::+ Select only files that are Added (`A`), Copied (`C`),+ Deleted (`D`), Modified (`M`), Renamed (`R`), have their+ type (i.e. regular file, symlink, submodule, ...) changed (`T`),+ are Unmerged (`U`), are+ Unknown (`X`), or have had their pairing Broken (`B`).+ Any combination of the filter characters (including none) can be used.+ When `*` (All-or-none) is added to the combination, all+ paths are selected if there is any file that matches+ other criteria in the comparison; if there is no file+ that matches other criteria, nothing is selected.+ -S<string>:: Look for differences that introduce or remove an instance of <string>. Note that this is different than the string simply
hasn't changed.
-C[<n>]::
---detect-copies[=<n>]::
+--find-copies[=<n>]::
Detect copies as well as renames. See also `--find-copies-harder`.
If `n` is specified, it has the same meaning as for `-M<n>`.
I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm
just being silly, but it sounds like those are directives, saying "I want you
to find copies/renames", as opposed to just saying "while you're working you
should also detect copies/renames". The original flag --find-copies-harder
is a bit different, because it's modifying the action of finding copies
rather than making finding copies the prime directive.
On the other hand, --detect-copies and --detect-renames sounds to me like
you're just telling it that it should, well, detect copies/renames as it goes
about its business.
-Kevin Ballard
hasn't changed.
-C[<n>]::
---detect-copies[=<n>]::
+--find-copies[=<n>]::
Detect copies as well as renames. See also `--find-copies-harder`.
If `n` is specified, it has the same meaning as for `-M<n>`.
I'm not sure I like the wording --find-copies and --find-renames. Maybe I'm
just being silly, but it sounds like those are directives, saying "I want you
to find copies/renames", as opposed to just saying "while you're working you
should also detect copies/renames". The original flag --find-copies-harder
is a bit different, because it's modifying the action of finding copies
rather than making finding copies the prime directive.
Well, I don't see how --find-copies-harder is much different: it is
just a more powerful version of -C, as seen by the fact that it implies -C.
On the other hand, --detect-copies and --detect-renames sounds to me like
you're just telling it that it should, well, detect copies/renames as it goes
about its business.
I can understand this. However, I feel that the fact they are just
options, as opposed to the explicit "diff/show/whatever" commands that
take them as modifiers, would be enough to balance the nuance in the
words. That may just be a matter of taste, but the consistency with
--find-copies-harder may be important here.
--
Yann