Skip to contentSkip to conversation

documentation-file-ref-check: Make git check work for multiple working directories

PATCH Applied Rob Herring 3 participants 3 messages Jun 3, 2021 – Jun 4, 2021 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 documentation-file-ref-check: Make git check work for multiple working directories

With multiple git working directories, '.git' may also be a text file linking to the actual git tree instead of a directory.

Cc Mauro Carvalho Chehab <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 scripts/documentation-file-ref-check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/documentation-file-ref-check +1 -1
index c71832b2312b..7187ea5e5149 100755
@@ -24,7 +24,7 @@ my $help = 0;
 my $fix = 0;
 my $warn = 0;
 
-if (! -d ".git") {
+if (! -e ".git") {
 	printf "Warning: can't check if file exists, as this is not a git tree\n";
 	exit 0;
 }
Signature · 1 line
2.27.0
Reviewed-by Tested-by on v1 1/1
#1 lore raw

Em Wed, 2 Jun 2021 20:28:06 -0500
Rob Herring <[email protected]> escreveu:

Quoted 2 lines

With multiple git working directories, '.git' may also be a text file linking to the actual git tree instead of a directory.

Good catch! Never tested inside a git worktree, as I use a separate git for docs patches due to a different [format] settings (due to a different c/c list).

Quoted 4 lines
Cc Mauro Carvalho Chehab <[email protected]>
Cc Jonathan Corbet <[email protected]>
Quoted 9 lines
---
 scripts/documentation-file-ref-check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/documentation-file-ref-check +0 -0
index c71832b2312b..7187ea5e5149 100755

scripts/documentation-file-ref-check my $help = 0; · line 30

Quoted 8 lines
scripts/documentation-file-ref-check +1 -1
@@ -24,7 +24,7 @@ my $help = 0;
 my $fix = 0;
 my $warn = 0;
 
-if (! -d ".git") {
+if (! -e ".git") {
 	printf "Warning: can't check if file exists, as this is not a git tree\n";
 	exit 0;
 }

Thanks,
Mauro

maintainer Applied
#2 lore raw
In reply to Rob Herring
Quoted 16 lines · Rob Herring

With multiple git working directories, '.git' may also be a text file linking to the actual git tree instead of a directory.

Cc Mauro Carvalho Chehab <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 scripts/documentation-file-ref-check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/documentation-file-ref-check +0 -0
index c71832b2312b..7187ea5e5149 100755

scripts/documentation-file-ref-check my $help = 0; · line 29

Quoted 7 lines
scripts/documentation-file-ref-check +1 -1
@@ -24,7 +24,7 @@ my $help = 0;
 my $fix = 0;
 my $warn = 0;
 
-if (! -d ".git") {
+if (! -e ".git") {
 	printf "Warning: can't check if file exists, as this is not a git tree\n";
 	exit 0;

Applied, thanks.

jon