Skip to contentSkip to conversation

scripts/get_maintainer: increase threshold for --follow to reduce time

PATCH In review Pranith Kumar 2 participants 5 messages Jul 12, 2014 – Jul 16, 2014 GET_MAINTAINER script

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/get_maintainer: increase threshold for --follow to reduce time

get_maintainer tries to follow files with a matching threshold of default 50%. This is not really necessary as we do not change a file and move it in the same commit usually. Increasing the threshold to 90% should be sufficient.

I encountered this on a recent commit where I was touching 12 files. Time take dropped from 24 sec to 12 sec after this change. It can be reduced further by increasing the threshold, but I think 90% is sufficient.

---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get_maintainer.pl +1 -1
index d701627..bc4a69e 100755
@@ -98,7 +98,7 @@ my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
     "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
-	"git log --no-color --follow --since=\$email_git_since " .
+	"git log --no-color --follow -M90 --since=\$email_git_since " .
 	    '--numstat --no-merges ' .
 	    '--format="GitCommit: %H%n' .
 		      'GitAuthor: %an <%ae>%n' .
Signature · 1 line
1.9.1
#1 lore raw

ping?

Quoted 29 lines · Pranith Kumar

get_maintainer tries to follow files with a matching threshold of default 50%. This is not really necessary as we do not change a file and move it in the same commit usually. Increasing the threshold to 90% should be sufficient.

I encountered this on a recent commit where I was touching 12 files. Time take dropped from 24 sec to 12 sec after this change. It can be reduced further by increasing the threshold, but I think 90% is sufficient.

---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get_maintainer.pl +1 -2
index d701627..bc4a69e 100755
@@ -98,7 +98,7 @@ my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
     "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
-       "git log --no-color --follow --since=\$email_git_since " .
+       "git log --no-color --follow -M90 --since=\$email_git_since " .
            '--numstat --no-merges ' .
            '--format="GitCommit: %H%n' .
                      'GitAuthor: %an <%ae>%n' .
--

1.9.1

Signature · 1 line
Pranith
maintainer
#2 lore raw
Quoted 6 lines · Pranith Kumar

ping?

Quoted 3 lines · Pranith Kumar

get_maintainer tries to follow files with a matching threshold of default 50%. This is not really necessary as we do not change a file and move it in the same commit usually. Increasing the threshold to 90% should be sufficient.

[]

Quoted 5 lines
Quoted 5 lines
scripts/get_maintainer.pl +0 -0
index d701627..bc4a69e 100755
@@ -98,7 +98,7 @@ my %VCS_cmds_git = (
Quoted 8 lines

scripts/get_maintainer.pl my %VCS_cmds_git = ( · line 104

Quoted 8 lines
scripts/get_maintainer.pl +1 -1
     "execute_cmd" => \&git_execute_cmd,
     "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
-       "git log --no-color --follow --since=\$email_git_since " .
+       "git log --no-color --follow -M90 --since=\$email_git_since " .
            '--numstat --no-merges ' .
            '--format="GitCommit: %H%n' .
                      'GitAuthor: %an <%ae>%n' .

While I understand the goal, I wonder if this should be in a .gitconfig, not in get_maintainers at all.

(git doesn't seem to have a config entry for score though)

If not, the % should probably be cmd-line configurable.

#3 lore raw
Quoted 7 lines · Joe Perches
Quoted 6 lines · Pranith Kumar

ping?

Quoted 3 lines · Pranith Kumar

get_maintainer tries to follow files with a matching threshold of default 50%. This is not really necessary as we do not change a file and move it in the same commit usually. Increasing the threshold to 90% should be sufficient.

<snip>

Quoted 8 lines

While I understand the goal, I wonder if this should be in a .gitconfig, not in get_maintainers at all.

(git doesn't seem to have a config entry for score though)

If not, the % should probably be cmd-line configurable.

The problem is with the default which is at 50% now. That means that a commit needs to have changed a file by more than 50% -and- moved it in the same commit. This is highly discouraged and unlikely to happen in our case.

Even if we have this a cmd-line configuration, setting the default to 90% really makes sense, no?

Signature · 1 line
Pranith
maintainer
#4 lore raw
Quoted 7 lines · Pranith Kumar

The problem is with the default which is at 50% now. That means that a commit needs to have changed a file by more than 50% -and- moved it in the same commit. This is highly discouraged and unlikely to happen in our case.

Even if we have this a cmd-line configuration, setting the default to 90% really makes sense, no?

Dunno. If it makes sense, maybe it makes global sense and should be the git default. If not, maybe other users have different needs and need some other cmdline option.