Skip to content

Commit b32f298

Browse files
committed
Merge branch 'jc/format-patch-more-aggressive-range-diff'
The default "creation-factor" used by "git format-patch" has been raised to make it more aggressively find matching commits. * jc/format-patch-more-aggressive-range-diff: format-patch: run range-diff with larger creation-factor
2 parents 3acecc0 + c22d41d commit b32f298

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Documentation/git-format-patch.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ material (this may change in the future).
357357
between the previous and current series of patches by adjusting the
358358
creation/deletion cost fudge factor. See linkgit:git-range-diff[1])
359359
for details.
360+
+
361+
Defaults to 999 (the linkgit:git-range-diff[1] uses 60), as the use
362+
case is to show comparison with an older iteration of the same
363+
topic and the tool should find more correspondence between the two
364+
sets of patches.
360365

361366
--notes[=<ref>]::
362367
--no-notes::

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
22962296
}
22972297

22982298
if (creation_factor < 0)
2299-
creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT;
2299+
creation_factor = CREATION_FACTOR_FOR_THE_SAME_SERIES;
23002300
else if (!rdiff_prev)
23012301
die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff");
23022302

range-diff.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
#define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60
88

9+
/*
10+
* A much higher value than the default, when we KNOW we are comparing
11+
* the same series (e.g., used when format-patch calls range-diff).
12+
*/
13+
#define CREATION_FACTOR_FOR_THE_SAME_SERIES 999
14+
915
struct range_diff_options {
1016
int creation_factor;
1117
unsigned dual_color:1;

0 commit comments

Comments
 (0)