Skip to content

Commit 8ff06de

Browse files
peffgitster
authored andcommitted
docs: document symlink restrictions for dot-files
We stopped allowing symlinks for .gitmodules files in 10ecfa7 (verify_path: disallow symlinks in .gitmodules, 2018-05-04), and we stopped following symlinks for .gitattributes, .gitignore, and .mailmap in the commits from 204333b (Merge branch 'jk/open-dotgitx-with-nofollow', 2021-03-22). The reasons are discussed in detail there, but we never adjusted the documentation to let users know. This hasn't been a big deal since the point is that such setups were mildly broken and thought to be unusual anyway. But it certainly doesn't hurt to be clear and explicit about it. Suggested-by: Philip Oakley <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bb6832d commit 8ff06de

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

Documentation/gitattributes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,12 @@ to:
12471247
[attr]binary -diff -merge -text
12481248
------------
12491249

1250+
NOTES
1251+
-----
1252+
1253+
Git does not follow symbolic links when accessing a `.gitattributes`
1254+
file in the working tree. This keeps behavior consistent when the file
1255+
is accessed from the index or a tree versus from the filesystem.
12501256

12511257
EXAMPLES
12521258
--------

Documentation/gitignore.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ not tracked by Git remain untracked.
149149
To stop tracking a file that is currently tracked, use
150150
'git rm --cached'.
151151

152+
Git does not follow symbolic links when accessing a `.gitignore` file in
153+
the working tree. This keeps behavior consistent when the file is
154+
accessed from the index or a tree versus from the filesystem.
155+
152156
EXAMPLES
153157
--------
154158

Documentation/gitmailmap.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ this would also match the 'Commit Name <commit&#64;email.xx>' above:
5555
Proper Name <[email protected]> CoMmIt NaMe <[email protected]>
5656
--
5757

58+
NOTES
59+
-----
60+
61+
Git does not follow symbolic links when accessing a `.mailmap` file in
62+
the working tree. This keeps behavior consistent when the file is
63+
accessed from the index or a tree versus from the filesystem.
64+
5865
EXAMPLES
5966
--------
6067

Documentation/gitmodules.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ submodule.<name>.shallow::
9898
shallow clone (with a history depth of 1) unless the user explicitly
9999
asks for a non-shallow clone.
100100

101+
NOTES
102+
-----
103+
104+
Git does not allow the `.gitmodules` file within a working tree to be a
105+
symbolic link, and will refuse to check out such a tree entry. This
106+
keeps behavior consistent when the file is accessed from the index or a
107+
tree versus from the filesystem, and helps Git reliably enforce security
108+
checks of the file contents.
101109

102110
EXAMPLES
103111
--------

0 commit comments

Comments
 (0)