From: Ihor Radchenko <yantar92@gmail.com>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org, Janek F <xerusx@pm.me>
Subject: Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]
Date: Sat, 13 Aug 2022 13:29:41 +0800 [thread overview]
Message-ID: <87wnbc7ltm.fsf@localhost> (raw)
In-Reply-To: <35cbf452-c3ed-d97f-db96-dcae57463eff@gmail.com>
Max Nikulin <manikulin@gmail.com> writes:
> was a really bad one. It leads to a separate directory for each short
> ID. However I still believe that the purpose of
> `org-attach-id-ts-folder-format' is avoid concentration of huge number
> of file in a single directory. Distribution of attachments over
> subdirectories is not perfectly even but it still works reasonably well
> for long-lasting projects while IDs follow assumed format and month is
> included into directory names.
This is only true for uuid-style. Also, this is likely not the problem
we need to worry about. To be a problem, the number of attach dirs
should be really large, which is only relevant when thousands of attach
dirs are cramped into a single parent directory. Thousands of attach
dirs would probably correspond to tens of thousands of headings, which
is not something we commonly have and, honestly, Org will have much more
serious issues when the number of headings is that large.
If someone ends up complaining about too many attach dirs, we can always
ask to adjust the ID naming scheme.
The previous paragraph appears to be consistent with
> Back to the original problem. First of all, I believe that if a user
> decided to use non-standard IDs then it is their responsibility to
> customize `org-attach-id-to-path-function-list' and to provide a
> function that implements alternative layout of attachment files.
> Depending on expected amount, they may be put into single directory,
> spread using some hash function, or accordingly to project structure. So
> today I am against default fallback directories especially in
> `org-attach-id-ts-folder-format'.
---
> I believe that interaction between `org-attach-dir-from-id' and members
> of `org-attach-id-to-path-function-list' could be improved. If a too
> short ID is passed to `org-attach-id-uuid-folder-format',
> `org-attach-id-ts-folder-format', or a user-defined function, they may
> return nil and `org-attach-dir-from-id' should try next element from the
> list. If nothing succeeds then a user error should be signaled demanding
> to implement a strategy to properly deal with peculiar IDs.
I do not think that it is a good idea. We currently promise to use the
first function in the list to generate the IDs. Other functions are
mostly a fallback to catch the existing attach dirs created in the past
using different ID scheme.
I guess that one option could be demanding a non-nil return value when
generating a new attach dir (without TRY-ALL argument) and wrapping
things into (ignore-errors ...) otherwise.
> There should be no problem to put single character IDs into a common
> directory (UUID case), but there are enough variants for 5 characters
> long names to create delayed performance problem. The worst case is when
> a user decides to use some common prefix, e.g. "id-" before UUID and all
> files go to the same directory. On the other hand I do not think that
> code should detect such cases.
We should not worry about this. It will be the user responsibility to
create the relevant custom function.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
next prev parent reply other threads:[~2022-08-13 5:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 19:12 [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)] Janek F
2022-07-23 5:22 ` [PATCH] " Ihor Radchenko
2022-08-02 22:26 ` Janek F
2022-08-03 16:03 ` Max Nikulin
2022-08-03 22:25 ` Ihor Radchenko
2022-08-10 11:43 ` [PATCH v2] " Ihor Radchenko
2022-08-10 12:17 ` Max Nikulin
2022-08-10 13:23 ` [PATCH v3] " Ihor Radchenko
2022-08-10 15:18 ` Max Nikulin
2022-08-11 4:19 ` Ihor Radchenko
2022-08-11 14:43 ` Max Nikulin
2022-08-13 5:29 ` Ihor Radchenko [this message]
2022-08-13 16:25 ` Max Nikulin
2022-08-14 4:00 ` Ihor Radchenko
2022-10-02 9:14 ` [PATCH v4] " Ihor Radchenko
2022-10-04 15:27 ` Max Nikulin
2022-10-05 5:44 ` Ihor Radchenko
2022-11-06 7:43 ` Ihor Radchenko
2022-11-07 17:05 ` [PATCH] org-attach.el: ID to path functions may return nil Max Nikulin
2022-11-08 5:08 ` Ihor Radchenko
2022-11-09 16:53 ` [PATCH v2] " Max Nikulin
2022-11-10 7:19 ` Ihor Radchenko
2022-11-13 16:26 ` Max Nikulin
2022-11-14 3:29 ` Ihor Radchenko
2022-11-14 16:59 ` Max Nikulin
2022-11-15 2:41 ` Ihor Radchenko
2022-11-15 16:41 ` Max Nikulin
2022-11-16 1:54 ` Ihor Radchenko
2022-08-12 15:35 ` [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)] Max Nikulin
2022-08-12 16:08 ` Janek F
2022-08-13 5:17 ` Ihor Radchenko
2022-08-13 15:59 ` Max Nikulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnbc7ltm.fsf@localhost \
--to=yantar92@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=manikulin@gmail.com \
--cc=xerusx@pm.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).