From d39b92c71cdbfd412fee60f5ef0f63c53d79a4be Mon Sep 17 00:00:00 2001 From: Ilya_Shlyakhter Date: Mon, 9 May 2022 19:21:15 +0000 Subject: [PATCH] Added a comment: interaction of out-of-tree symlinks with exporttree --- ..._778e176a44aa57e9223aab1a45c931f3._comment | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/bugs/git-annex-import_imports_outside_of_directory/comment_3_778e176a44aa57e9223aab1a45c931f3._comment diff --git a/doc/bugs/git-annex-import_imports_outside_of_directory/comment_3_778e176a44aa57e9223aab1a45c931f3._comment b/doc/bugs/git-annex-import_imports_outside_of_directory/comment_3_778e176a44aa57e9223aab1a45c931f3._comment new file mode 100644 index 0000000000..59910a05ec --- /dev/null +++ b/doc/bugs/git-annex-import_imports_outside_of_directory/comment_3_778e176a44aa57e9223aab1a45c931f3._comment @@ -0,0 +1,19 @@ +[[!comment format=mdwn + username="Ilya_Shlyakhter" + avatar="http://cdn.libravatar.org/avatar/1647044369aa7747829c38b9dcc84df0" + subject="interaction of out-of-tree symlinks with exporttree" + date="2022-05-09T19:21:15Z" + content=""" +One other scenario where the result might not be what users expect is the following: if a [[directory special remote|/special_remotes/directory]] is configured with both [[`importtree=yes`|git-annex-import]] and [[`exporttree=yes`|git-annex-export]], and the directory contains symlinks pointing outside the tree, then an import followed by an export will replace the symlink in the original directory with a copy of the content. + +>a symlink that points outside the git repository, which is not something one often wants to check into a git repository + +Such a symlink is already not something one often has :) But if one does, then the repo is likely for one's own usage, or for the usage by people with access to the shared filesystem where the link works, so adding the link to git as-is makes sense. Logically, it's likely that the out-of-tree link target represents some separate tree of files that you don't think of as part of the tree (or you'd have put them under the tree); if you did want to import them, you'd make a separate repo for them and import them as a submodule. + +Also, what happens if the target tree of the out-of-tree link has a symlink back to the original tree -- could this cause infinite recursion? + +The [[`git-annex-import` man page|git-annex-import]] says the command imports \"a tree of files\". It seems simplest if this description was always strictly true, regardless of what's in the tree. But if you decide to keep the current default, maybe clarify the web page? + +Thanks again for all your work. + +"""]] -- 2.30.2