From: Felipe Gonçalves Assis <hidden> Date: 2016-06-15 23:08:16
No more renames option. rename-threshold enables renames.
detect_rename is now a simple boolean. Its value is no longer linked to
DIFF_ANYTHING symbol.
A second optional patch is included, teaching merge-recursive to take
"find-renames[=<n>]" as well, for consistency.
Felipe Gonçalves Assis (2):
merge-recursive: option to disable renames
merge-recursive: more consistent interface
Documentation/merge-strategies.txt | 14 ++++++++++++--
merge-recursive.c | 12 +++++++++++-
merge-recursive.h | 1 +
3 files changed, 24 insertions(+), 3 deletions(-)
--
2.7.1.288.gfad33a8
@@ -81,8 +81,14 @@ no-renormalize;; Disables the `renormalize` option. This overrides the `merge.renormalize` configuration variable.+no-renames;;+ Turn off rename detection.+ See also linkgit:git-diff[1] `--no-renames`.+ rename-threshold=<n>;; Controls the similarity threshold used for rename detection.+ Re-enables rename detection if disabled by a preceding+ `no-renames`. See also linkgit:git-diff[1] `-M`. subtree[=<path>];;
From: Felipe Gonçalves Assis <hidden> Date: 2016-06-15 23:08:16
Add strategy option find-renames, following git-diff interface. This
makes the option rename-threshold redundant.
---
A minor note
git diff --check complains about an indent with spaces here, but I think I did
the right thing: indented with tabs and aligned with spaces. If desired, I can
align with tabs to avoid this.
Documentation/merge-strategies.txt | 8 ++++++--
merge-recursive.c | 5 ++++-
2 files changed, 10 insertions(+), 3 deletions(-)
@@ -85,11 +85,15 @@ no-renames;; Turn off rename detection. See also linkgit:git-diff[1] `--no-renames`.-rename-threshold=<n>;;+find-renames[=<n>];; Controls the similarity threshold used for rename detection. Re-enables rename detection if disabled by a preceding `no-renames`.- See also linkgit:git-diff[1] `-M`.+ See also linkgit:git-diff[1] `--find-renames`.++rename-threshold=<n>;;+ Synonym for `find-renames=<n>`. Present for historical reasons.+ New scripts should prefer the `find-renames=<n>` syntax. subtree[=<path>];; This option is a more advanced form of 'subtree' strategy, where
From: Eric Sunshine <hidden> Date: 2016-06-15 23:08:16
On Tue, Feb 16, 2016 at 8:11 PM, Felipe Gonçalves Assis
[off-list ref] wrote:
No more renames option. rename-threshold enables renames.
Can you add some tests? Off the top of my head, I'd expect to see at
least three new tests:
1. --no-renames works as expected
2. last wins in "--no-renames --rename-threshold=x"
3. last wins in "--rename-threshold=x --no-renames"
A second optional patch is included, teaching merge-recursive to take
"find-renames[=<n>]" as well, for consistency.
Tests should also accompany this change. A couple obvious ones:
1. --find-rename=x works as synonym for --rename-threshold=x
2. --fine-rename (without "=x") works as expected
Thanks.
From: Eric Sunshine <hidden> Date: 2016-06-15 23:08:16
On Tue, Feb 16, 2016 at 8:11 PM, Felipe Gonçalves Assis
[off-list ref] wrote:
quoted hunk
The recursive strategy turns on rename detection by default. Add a
strategy option to disable rename detection even for exact renames.
Signed-off-by: Felipe Gonçalves Assis <redacted>
---
@@ -81,8 +81,14 @@ no-renormalize;;+no-renames;;+ Turn off rename detection.+ See also linkgit:git-diff[1] `--no-renames`.+ rename-threshold=<n>;; Controls the similarity threshold used for rename detection.+ Re-enables rename detection if disabled by a preceding+ `no-renames`.
I'm not sure that it is necessary to mention the "last one wins" rule
here, but if you do so, does --no-renames documentation deserve
similar treatment?
@@ -85,11 +85,15 @@ no-renames;; Turn off rename detection. See also linkgit:git-diff[1] `--no-renames`.-rename-threshold=<n>;;+find-renames[=<n>];; Controls the similarity threshold used for rename detection. Re-enables rename detection if disabled by a preceding `no-renames`.
This may need some enhancement. It doesn't, for instance, talk about
what bare --find-renames (without "=n") means.
- See also linkgit:git-diff[1] `-M`.
+ See also linkgit:git-diff[1] `--find-renames`.
+
+rename-threshold=<n>;;
+ Synonym for `find-renames=<n>`. Present for historical reasons.
+ New scripts should prefer the `find-renames=<n>` syntax.
It might be sufficient to say merely:
Deprecated synonym for `--find-renames=<n>`.
which implies the bits about "historical reasons" and "new scripts
should prefer...".
quoted hunk
subtree[=<path>];;
This option is a more advanced form of 'subtree' strategy, where
From: Felipe Gonçalves Assis <hidden> Date: 2016-06-15 23:08:16
On 16 February 2016 at 23:41, Eric Sunshine [off-list ref] wrote:
On Tue, Feb 16, 2016 at 8:11 PM, Felipe Gonçalves Assis
[off-list ref] wrote:
quoted
The recursive strategy turns on rename detection by default. Add a
strategy option to disable rename detection even for exact renames.
Signed-off-by: Felipe Gonçalves Assis <redacted>
---
@@ -81,8 +81,14 @@ no-renormalize;;+no-renames;;+ Turn off rename detection.+ See also linkgit:git-diff[1] `--no-renames`.+ rename-threshold=<n>;; Controls the similarity threshold used for rename detection.+ Re-enables rename detection if disabled by a preceding+ `no-renames`.
I'm not sure that it is necessary to mention the "last one wins" rule
here, but if you do so, does --no-renames documentation deserve
similar treatment?
It is not so much about the "last one wins" rule, but about the fact
that, given the sub-optimal name, it is not obvious that this option
even enables renaming. The wording is just the best way I found to
explain that without creating additional confusion.
I will apply your suggestion on the second commit. Please see the next
patch proposal and tell what you think.
Thanks,
Felipe
From: Felipe Gonçalves Assis <hidden> Date: 2016-06-15 23:08:17
On 16 February 2016 at 23:37, Eric Sunshine [off-list ref] wrote:
On Tue, Feb 16, 2016 at 8:11 PM, Felipe Gonçalves Assis
[off-list ref] wrote:
quoted
No more renames option. rename-threshold enables renames.
Can you add some tests? Off the top of my head, I'd expect to see at
least three new tests:
1. --no-renames works as expected
2. last wins in "--no-renames --rename-threshold=x"
3. last wins in "--rename-threshold=x --no-renames"
Sure.
Just a heads up: For the next three days I will have very little time,
so I will start tackling this on the weekend. I submitted a fourth
version of the patch without the tests, so that this part of the work
can proceed in parallel.
Thanks,
Felipe