From: Pete Wyckoff <pw@padd.com>
To: Vitor Antunes <vitor.hda@gmail.com>
Cc: git@vger.kernel.org, Tor Arvid Lund <torarvid@gmail.com>
Subject: Re: [PATCH 1/4] git-p4: Allow setting rename/copy detection threshold.
Date: Thu, 18 Aug 2011 08:18:47 -0700 [thread overview]
Message-ID: <20110818151847.GA2043@padd.com> (raw)
In-Reply-To: <1313629459-22937-2-git-send-email-vitor.hda@gmail.com>
vitor.hda@gmail.com wrote on Thu, 18 Aug 2011 02:04 +0100:
> Copy and rename detection arguments (-C and -M) allow setting a threshold value
> for the similarity ratio. If the similarity is below this threshold the rename
> or copy is ignored and the file is added as new.
> This patch allows setting git-p4.detectRenames and git-p4.detectCopies options
> to an integer value to set the respective threshold.
[..]
> - if self.detectRenames:
> + diffOpts = ""
> + if self.detectRenames.lower() == "true":
> diffOpts = "-M"
> - else:
> - diffOpts = ""
> + elif self.detectRenames != "":
> + self.detectRenames = int(self.detectRenames)
> + if self.detectRenames >= 0 and self.detectRenames <= 100:
> + diffOpts = "-M%d" % self.detectRenames
>
This is a good idea. But I notice that -M, -C, -B can take
a diverse set of option forms, including floating point and
optional "%". "-B" can take two args, separated by a "/".
See diff_scoreopt_parse(). It would be weird for git-p4 to limit
that set to integers like you do here.
Would you be willing to change it to pass the string blindly?
Just filter out the special values, and pass everything else
unchanged.
"true" -> "-M"
"false" -> ""
"" -> ""
".*" -> "\1"
Dunno if you care about --break-rewrites. Just pointing to it
as a similar option to -M and -C in case you missed it.
-- Pete
next prev parent reply other threads:[~2011-08-18 15:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 1:04 [PATCH 0/4] Support threshold in copy/rename detection Vitor Antunes
2011-08-18 1:04 ` [PATCH 1/4] git-p4: Allow setting rename/copy detection threshold Vitor Antunes
2011-08-18 15:18 ` Pete Wyckoff [this message]
2011-08-18 21:50 ` Vitor Antunes
2011-08-18 1:04 ` [PATCH 2/4] git-p4: Add description of rename/copy detection options Vitor Antunes
2011-08-18 1:04 ` [PATCH 3/4] git-p4: Add test case for rename detection Vitor Antunes
2011-08-18 1:04 ` [PATCH 4/4] git-p4: Add test case for copy detection Vitor Antunes
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=20110818151847.GA2043@padd.com \
--to=pw@padd.com \
--cc=git@vger.kernel.org \
--cc=torarvid@gmail.com \
--cc=vitor.hda@gmail.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).