diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-05-28 11:17:10 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-28 11:17:10 -0700 |
| commit | b32f298264d9df8febc9942c196eaf7e82c86184 (patch) | |
| tree | 505b9d718fb68565d322cd66e2c22ffb8813d0c1 | |
| parent | 3acecc04c7f2b90c481062b227b1b8f44af9132c (diff) | |
| parent | c22d41d641711879c57299244ae13b6c4a215fee (diff) | |
| download | git-b32f298264d9df8febc9942c196eaf7e82c86184.tar.gz | |
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
| -rw-r--r-- | Documentation/git-format-patch.txt | 5 | ||||
| -rw-r--r-- | builtin/log.c | 2 | ||||
| -rw-r--r-- | range-diff.h | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 369af2c4a7..8708b31593 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -357,6 +357,11 @@ material (this may change in the future). between the previous and current series of patches by adjusting the creation/deletion cost fudge factor. See linkgit:git-range-diff[1]) for details. ++ +Defaults to 999 (the linkgit:git-range-diff[1] uses 60), as the use +case is to show comparison with an older iteration of the same +topic and the tool should find more correspondence between the two +sets of patches. --notes[=<ref>]:: --no-notes:: diff --git a/builtin/log.c b/builtin/log.c index b17dd8b40a..c8ce0c0d88 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -2296,7 +2296,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) } if (creation_factor < 0) - creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT; + creation_factor = CREATION_FACTOR_FOR_THE_SAME_SERIES; else if (!rdiff_prev) die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff"); diff --git a/range-diff.h b/range-diff.h index 04ffe217be..2f69f6a434 100644 --- a/range-diff.h +++ b/range-diff.h @@ -6,6 +6,12 @@ #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60 +/* + * A much higher value than the default, when we KNOW we are comparing + * the same series (e.g., used when format-patch calls range-diff). + */ +#define CREATION_FACTOR_FOR_THE_SAME_SERIES 999 + struct range_diff_options { int creation_factor; unsigned dual_color:1; |
