This series adds support both for not deduplicating addresses in notmuch
address, and for using just the case insensitive address part of an email
address. The new deduplication picks the most popular variant.
Real life examples, current deduplication:
$ notmuch address --output=count
We'll be needing more mailbox creation soon, so abstract it
away. While at it, check for allocation failures. No other functional
changes.
---
notmuch-search.c | 23 +++
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/notmuch-search.c b/notmuch-search.c
index
Switch to normal glib hash table lookup. The extended version is only
required if the values may contain NULL.
---
notmuch-search.c | 21 ++---
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/notmuch-search.c b/notmuch-search.c
index 3076c3f637b1..7fdc6acaa2fe
Make it possible to use notmuch address as part of a | sort | uniq -c
pipe instead of forcing --output=count. This is useful for combining
results from multiple notmuch address queries.
---
notmuch-search.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/notmuch-search.c
Currently we key the address hash table with the case sensitive name
address. Switch to case insensitive keying with just address, and
store the case sensitive name and address in linked lists. This will
be helpful in adding support different deduplication schemes in the
future. There will be a
Jani Nikula j...@nikula.org writes:
+static int
+strcase_equal (const void *a, const void *b)
+{
+return strcasecmp (a, b) == 0;
+}
+
+static unsigned int
+strcase_hash (const void *ptr)
+{
+const char *s = ptr;
+
+/* This is the djb2 hash. */
+unsigned int hash =
Jani Nikula j...@nikula.org writes:
+ { NOTMUCH_OPT_KEYWORD, ctx-dupe, deduplicate, 'x',
probably you want 'D' or 'd' here. Not that it makes a practical
difference at this point.
+ (notmuch_keyword_t []){ { yes, -1 },
I'm not very enthusiastic about reusing ctx-dupe for this.
In