From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Git Mailing list <git@vger.kernel.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Eric Sunshine <sunshine@sunshineco.com>
Subject: [WIP PATCH/RFC] Use a higher range-diff --creation-factor for format-patch
Date: Fri, 15 Mar 2019 17:09:39 +0100 [thread overview]
Message-ID: <87y35g9l18.fsf@evledraar.gmail.com> (raw)
I just submittted
https://public-inbox.org/git/20190315155959.12390-1-avarab@gmail.com/
and for 8/8 had to tweak the creation factor to 80% due to having added
a large comment. Maybe something like the below makes more sense for
format-patch?
Also, the "Algorithm" section of git-range-diff describes how we'll try
to find a percentage similarity in the *diff*, but in this case I'm
fairly sure that e.g. a creation factor of 50 would do if it also
considered the commit message.
Maybe I'm just wrong and it does that already, but assuming I'm right in
my reading and it doesn't, was that ever considered? That should result
in fewer false "not the same patch" positives, but maybe if patches are
split up it'll screw things up in other ways.
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 1af85d404f5..67a4881a20f 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -261,6 +261,10 @@ 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 90, whereas the linkgit:git-range-diff[1] default is
+60. It's assumed that you're submitting a new patch series & that we
+should try harder than normal to find similarities.
--notes[=<ref>]::
Append the notes (see linkgit:git-notes[1]) for the commit
diff --git a/builtin/log.c b/builtin/log.c
index ab859f59041..ff340130826 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1843,7 +1843,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 = RANGE_DIFF_CREATION_FACTOR_FORMAT_PATCH_DEFAULT;
else if (!rdiff_prev)
die(_("--creation-factor requires --range-diff"));
diff --git a/range-diff.h b/range-diff.h
index 08a50b6e98f..634112396d3 100644
--- a/range-diff.h
+++ b/range-diff.h
@@ -4,6 +4,7 @@
#include "diff.h"
#define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60
+#define RANGE_DIFF_CREATION_FACTOR_FORMAT_PATCH_DEFAULT 90
/*
* Compare series of commmits in RANGE1 and RANGE2, and emit to the
next reply other threads:[~2019-03-15 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 16:09 Ævar Arnfjörð Bjarmason [this message]
2019-03-15 19:00 ` [WIP PATCH/RFC] Use a higher range-diff --creation-factor for format-patch Eric Sunshine
2019-03-15 19:21 ` Ævar Arnfjörð Bjarmason
2019-03-21 11:22 ` Johannes Schindelin
2019-03-18 5:23 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y35g9l18.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).