linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] get_maintainer: Fix detection of git repository
@ 2014-01-30 14:34 Richard Genoud
  2014-01-30 14:34 ` [PATCH 2/2] checkpatch: " Richard Genoud
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Genoud @ 2014-01-30 14:34 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Richard Genoud

Since git v1.7.7, the .git directory can be a file when, for example,
the kernel is a submodule of another git super project.
So, the check "-d .git" is not working anymore in this case.
Using a more generic check like "-e .git" corrects this behaviour.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 scripts/get_maintainer.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 9c3986f4140c..41987885bd31 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -95,7 +95,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 " .
 	    '--numstat --no-merges ' .
-- 
1.8.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] checkpatch: Fix detection of git repository
  2014-01-30 14:34 [PATCH 1/2] get_maintainer: Fix detection of git repository Richard Genoud
@ 2014-01-30 14:34 ` Richard Genoud
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Genoud @ 2014-01-30 14:34 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Richard Genoud

Since git v1.7.7, the .git directory can be a file when, for example,
the kernel is a submodule of another git super project.
So, the check "-d .git" is not working anymore in this case.
Using a more generic check like "-e .git" corrects this behaviour.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0ea2a1e24ade..464dcef79b35 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -471,7 +471,7 @@ sub seed_camelcase_includes {
 
 	$camelcase_seeded = 1;
 
-	if (-d ".git") {
+	if (-e ".git") {
 		my $git_last_include_commit = `git log --no-merges --pretty=format:"%h%n" -1 -- include`;
 		chomp $git_last_include_commit;
 		$camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit";
@@ -499,7 +499,7 @@ sub seed_camelcase_includes {
 		return;
 	}
 
-	if (-d ".git") {
+	if (-e ".git") {
 		$files = `git ls-files "include/*.h"`;
 		@include_files = split('\n', $files);
 	}
-- 
1.8.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-30 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30 14:34 [PATCH 1/2] get_maintainer: Fix detection of git repository Richard Genoud
2014-01-30 14:34 ` [PATCH 2/2] checkpatch: " Richard Genoud

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).