Skip to contentSkip to conversation

scripts: Detect git worktrees for get_maintainer.pl --git

PATCH Applied Alexey Kardashevskiy 4 participants 4 messages Nov 12, 2019 GET_MAINTAINER script

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: Detect git worktrees for get_maintainer.pl --git

Recent git versions support worktrees where .git is not a directory but a file with a path to the .git repository; however the get_maintainer.pl script only recognises the .git directory, let's fix it.

---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get_maintainer.pl +1 -1
index 71415e3c7061..27991eb1cfb4 100755
@@ -81,7 +81,7 @@ my %VCS_cmds;
 
 my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
-    "available" => '(which("git") ne "") && (-d ".git")',
+    "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
 	"git log --no-color --follow --since=\$email_git_since " .
 	    '--format="GitCommit: %H%n' .
Signature · 1 line
2.17.1
Tested-by Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alexey Kardashevskiy

Recent git versions support worktrees where .git is not a directory but a file with a path to the .git repository; however the get_maintainer.pl script only recognises the .git directory, let's fix it.

---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Stefano

Quoted 17 lines
scripts/get_maintainer.pl +1 -1
index 71415e3c7061..27991eb1cfb4 100755
@@ -81,7 +81,7 @@ my %VCS_cmds;
 
 my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
-    "available" => '(which("git") ne "") && (-d ".git")',
+    "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
 	"git log --no-color --follow --since=\$email_git_since " .
 	    '--format="GitCommit: %H%n' .
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Alexey Kardashevskiy
Quoted 6 lines · On Tue, 12 Nov 2019 14:45:32 +1100 Alexey Kardashevskiy <[email protected]> wrote:

Recent git versions support worktrees where .git is not a directory but a file with a path to the .git repository; however the get_maintainer.pl script only recognises the .git directory, let's fix it.

---

Makes sense. The script in the linux kernel tree has this since 2014 BTW :)

Quoted 16 lines
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get_maintainer.pl +1 -1
index 71415e3c7061..27991eb1cfb4 100755
@@ -81,7 +81,7 @@ my %VCS_cmds;
 
 my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
-    "available" => '(which("git") ne "") && (-d ".git")',
+    "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
 	"git log --no-color --follow --since=\$email_git_since " .
 	    '--format="GitCommit: %H%n' .
#3 lore raw
In reply to Alexey Kardashevskiy
Quoted 15 lines · Alexey Kardashevskiy

Recent git versions support worktrees where .git is not a directory but a file with a path to the .git repository; however the get_maintainer.pl script only recognises the .git directory, let's fix it.

---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get_maintainer.pl +0 -0
index 71415e3c7061..27991eb1cfb4 100755

scripts/get_maintainer.pl my %VCS_cmds; · line 87

Quoted 8 lines
scripts/get_maintainer.pl +1 -1
@@ -81,7 +81,7 @@ my %VCS_cmds;
 
 my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
-    "available" => '(which("git") ne "") && (-d ".git")',
+    "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
 	"git log --no-color --follow --since=\$email_git_since " .
 	    '--format="GitCommit: %H%n' .

Queued, thanks.

Paolo