Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate directories need to have a managed file at the top level #328

Closed
aes opened this issue Apr 13, 2021 · 4 comments
Closed

Alternate directories need to have a managed file at the top level #328

aes opened this issue Apr 13, 2021 · 4 comments

Comments

@aes
Copy link

aes commented Apr 13, 2021

Alternate directories need to have a managed file at the top level.

The documentation says that "Links are also created for directories named this way, as long as they have at least one yadm managed file within them." It should either be corrected to point out that they need a file at the top level, (ok) or yadm should be fixed work as advertised. (better!)

To reproduce

$ cd
$ mkdir -p foo##default/dir/sub
$ touch foo##default/dir/sub/file
$ /yadm/yadm init
$ /yadm/yadm add foo##default/dir/sub/file
$ /yadm/yadm alt

Add this and it works:

$ touch foo##default/.this_is_an_alt_damnit
$ /yadm/yadm add foo##default/.this_is_an_alt_damnit
$ ls -l

Expected behavior

I expected an alternate symlink.

Environment

  • Operating system: Ubuntu 20.04.2 LTS
  • Version yadm: 3.1.0 (a4d39c)
  • Version Git: 2.25.1

Additional context

Debugging, trying to figure this out, I came to this, which (I think) strips one level: "${tracked%/*}", here on line 639:

  for alt_path in $(for tracked in "${tracked_files[@]}"; do printf "%s\n" "$tracked" "${tracked%/*}"; done | LC_ALL=C sort -u) "${ENCRYPT_INCLUDE_FILES[@]}"; do
@aes aes added the bug label Apr 13, 2021
@coderforlife
Copy link

I just ran into this problem as well. My current workaround is to put a managed .placeholder file in the directory, but agree it should be handled correctly within yadm.

@github-actions
Copy link

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions
Copy link

github-actions bot commented Mar 1, 2022

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@jluttine
Copy link

Why does the file need to be at the top-level? Is there a reason why yadm has such a requirement? I don't understand why it's not ok to have the files deeper in the directory hierarchy...

I'm asking because this issue was fixed by updating the documentation instead of accepting files deeper in the directory hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants