Hello, I have a collection of org files in a git repository, and am using git-annex for attachments. I had an idea for a feature related to org-attach-directory that would improve the usability of git-annex in a case like this.
Since all attachments from all org files in the repo go into the same data directory, there isn't a simple way to operate on the attachments related to a single org file in bulk. For instance, if one wants to git-annex-get all of the attachments for one org file, but not others, one must git-annex-get each file individually. One solution would be for each org file to live in its own subdirectory, thus each org file would have its own data directory: org-file: org/work/work.org attachemts-in: org/work/data/ I don't especially like this solution because it adds a lot of unnecessary structure to the repo. Another solution would be for each org file to have its own data directory alongside it: org-file: org/work.org attachments-in: org/work.org.data/ I don't especially like this one either because it makes a mess of the repository root. The solution I like best is to store attachments in data/, but to introduce a subdirectory per org file: org-file: org/work.org attachments-in: org/data/work.org/ It keeps the repository root uncluttered, but attachments are grouped by the file that owns them, so can be operated on in bulk by git-annex or other tools. I can set up this configuration with org-mode-hook, but I liked the idea so well that I wanted to pass it along as something that org-mode might want to provide itself as an option. Perhaps org-mode could check for the existence of data/{filename} and when it exists, set the local value of org-attach-directory to that instead of to "data/". If it were automatic like this, then org files that used this feature would remain portable. Perhaps a file-local variable or an org directive would be a better option. Any thoughts? Thank you, John Foerch