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

git-annex support #2616

Closed
anarcat opened this issue Jun 28, 2017 · 2 comments
Closed

git-annex support #2616

anarcat opened this issue Jun 28, 2017 · 2 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Jun 28, 2017

Problem

I use git-annex to maintain my music library. This means that all committed files are actually read-only. When beets is allowed to write to files (move: yes or write: yes), it will fail to do the right thing because it naively thinks it can just write to files...

Setup

  • OS: Debian stretch
  • Python version: 2.7.13
  • beets version: 1.3.18

A rough git-annex 101 tutorial to reproduce this would be:

mkdir music
git annex import --duplicate ~/some_album # don't do this on your main collection, you may have some surprises!
git commit -m"new files"
beets import # this will fail because the files are now read-only.

Proposed solution

I am thinking of a plugin that would run git-annex-unlock on files before editing them. I assume I would need to hook into before_item_moved and write to do this. One could simply just deny writes on those files, although it's unclear to me how to deny "moving" files...

@sampsyo
Copy link
Member

sampsyo commented Jun 29, 2017

Hi! You may want to take a look at #838, which discusses roughly the same idea. For example, there's a suggestion there that the new hook plugin could help you run the command automatically without writing a new plugin.

For now, you can also consider disable the import.move and import.copy options to leave files in place on the filesystem.

@sampsyo sampsyo closed this as completed Jun 29, 2017
@anarcat
Copy link
Contributor Author

anarcat commented Jun 29, 2017

didn't find that one when i searched, thanks for the pointers!

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

No branches or pull requests

2 participants