-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Description of the issue:
khard list displays unique prefixes of the UID field,
which is sufficient and convenient to uniquely identify a contact.
However, the search query uid:xxx returns all contacts having "xxx" as a
substring of their UID, not just a prefix.
This makes the displayed UID prefix useless as a unique identifier for
selecting contacts for viewing or editing.
Minimal problematic case:
Consider an address book with two contacts:
- one with "UID: aaabbbb", and
- one with "UID: bbbaaaa".
khard list correctly displays:
- the first with short Uid prefix
a, and - the second with short Uid prefix
b.
But khard edit uid:a matches both instead of only the first,
because "a" is a substring of both UIDs!
Workaround:
The full UID can be displayed with --parsable,
which makes it usable in scripts but is bad for humans.
Related issue:
- khard show <uid> - anchor to start of uid ? #136:
However, the--uidparameter is now deprecated in favour of the new search
query styleuid:something, which is the object of the current issue.
Going further:
I think that working unique short UID prefixes could completely replace the
Index column. Those numeric indexes have the issue of being tied to a
particular context, therefore ephemeral and confusing, while not necessarily
shorter than UID prefixes.
Version info:
- Khard version 0.18.0
- Python 3.10.12
- NixOS 23.05