projects/dandi/bugs-done/impossible(?) to continuously re-import a directory while keeping original files in placeyohhttp://git-annex.branchable.com/projects/dandi/bugs-done/impossible__40____63____41___to_continuously_re-import_a_directory_while_keeping_original_files_in_place/git-annexikiwiki2023-01-05T17:30:31Zcomment 1http://git-annex.branchable.com/projects/dandi/bugs-done/impossible__40____63____41___to_continuously_re-import_a_directory_while_keeping_original_files_in_place/comment_1_d385d0fffdd6ac18f38828f805e4daff/joey2023-01-05T17:30:31Z2019-11-19T17:12:41Z
<p>I think that you can accomplish what you want by making the directory
you're importing from be a directory special remote with exporttree=yes
importtree=yes and use the new <code>git annex import master --from remote</code></p>
<p>If that does not do what you want, I'd prefer to look at making it be able
to do so. I hope to eventually remove the legacy git-annex import from
directory, since we have this new more general interface.</p>
comment 2http://git-annex.branchable.com/projects/dandi/bugs-done/impossible__40____63____41___to_continuously_re-import_a_directory_while_keeping_original_files_in_place/comment_2_0c6006b53f97515c1ed31d8d4ab464cc/joey2023-01-05T17:30:31Z2020-03-30T15:50:17Z
Tagged moreinfo since I'm waiting on a reply to my suggestion.
comment 3http://git-annex.branchable.com/projects/dandi/bugs-done/impossible__40____63____41___to_continuously_re-import_a_directory_while_keeping_original_files_in_place/comment_3_300f74178ef17e2e549fd7a04a262428/yarikoptic2023-01-05T17:30:31Z2020-10-06T01:26:59Z
<p>I think it worked wonderfully</p>
<p><details>
<summary>here is my script I have tried</summary></p>
<pre><code class="shell">#!/bin/bash
export PS4='> '
set -x
set -eu
cd "$(mktemp -d ${TMPDIR:-/tmp}/dl-XXXXXXX)"
mkdir d-in d-repo
echo content >| d-in/file
function dance() {
git annex import master --from d-in
# but we need to merge it
git merge d-in/master
ls -l
grep -e . *
}
(
cd d-repo
git init
git annex init
git annex initremote d-in type=directory directory=../d-in exporttree=yes importtree=yes encryption=none
ls -l ../d-in
for r in 1 2; do
echo "Run $r";
dance
done
echo "more" >> ../d-in/file
echo "new" > ../d-in/newfile
dance
rm ../d-in/file
dance
)
</code></pre>
<p></details></p>
<p>and it seemed to do the right job! I have not tried to add some <code>.gitattributes</code> into that branch it imports into to tell some files to go to git, but I hope it would just work, and if not -- I will come back! feel welcome to close this issue.</p>
<p>Cheers</p>