From 8cef8ac69c8f235a5982d6a75d08ef2e4d27c992 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 28 Dec 2019 07:48:06 +0200 Subject: [PATCH] Revert "mu: default to include related, skip dups" Changing the default for 'mu find' turns out to be a bit too disruptive for people that use `mu find` for scripting... so let's revert this for now. This reverts commit f86ed12eb31e2e020b10e837db92568997af4387. --- man/mu-find.1 | 20 ++++++++++---------- mu/mu-cmd-find.c | 4 ++-- mu/mu-config.c | 22 +++++----------------- mu/mu-config.h | 11 ++++++----- mu/tests/test-mu-cmd.c | 2 +- 5 files changed, 24 insertions(+), 35 deletions(-) diff --git a/man/mu-find.1 b/man/mu-find.1 index cc0e69ac..53e23954 100644 --- a/man/mu-find.1 +++ b/man/mu-find.1 @@ -42,7 +42,7 @@ The search pattern is taken as a command-line parameter. If the search parameter consists of multiple parts (as in the example) they are treated as if there were a logical \fBand\fR between them. -For details on the possible queries, see +For details on the possible queries, see @@ -209,17 +209,17 @@ details of the bookmarks file. .TP -\fB\-\-include\-dups\fR,\fB-u\fR by default, whenever there are multiple -messages with the same name, only show the first one. This is useful if you have -copies of the same message, which is a common occurrence when using e.g. Gmail -together with \fBofflineimap\fR. Use this option to turn that behavior off. +\fB\-\-skip\-dups\fR,\fB-u\fR whenever there are multiple messages with the +same name, only show the first one. This is useful if you have copies of the +same message, which is a common occurrence when using e.g. Gmail together with +\fBofflineimap\fR. .TP -\fB\-\-skip\-related\fR,\fB-r\fR by default, the results include messages being -refered to by the matched messages -- i.e.. include messages that are part of -the same message thread as some matched messages. This is useful if you want -Gmail-style 'conversations'. Note, finding these related messages make searches -slightly slower. Use this option to turn that behavior off. +\fB\-\-include\-related\fR,\fB-r\fR also include messages being refered to by +the matched messages -- i.e.. include messages that are part of the same +message thread as some matched messages. This is useful if you want +Gmail-style 'conversations'. Note, finding these related messages make +searches slower. .TP \fB\-t\fR, \fB\-\-threads\fR show messages in a 'threaded' format -- that is, diff --git a/mu/mu-cmd-find.c b/mu/mu-cmd-find.c index fbca90ad..47e2d135 100644 --- a/mu/mu-cmd-find.c +++ b/mu/mu-cmd-find.c @@ -131,9 +131,9 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts, GError **err) qflags = MU_QUERY_FLAG_NONE; if (opts->reverse) qflags |= MU_QUERY_FLAG_DESCENDING; - if (!opts->include_dups) + if (opts->skip_dups) qflags |= MU_QUERY_FLAG_SKIP_DUPS; - if (!opts->skip_related) + if (opts->include_related) qflags |= MU_QUERY_FLAG_INCLUDE_RELATED; if (opts->threads) qflags |= MU_QUERY_FLAG_THREADS; diff --git a/mu/mu-config.c b/mu/mu-config.c index 1b9cd333..9660a787 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -210,24 +210,12 @@ config_options_group_find (void) "use a bookmarked query", ""}, {"reverse", 'z', 0, G_OPTION_ARG_NONE, &MU_CONFIG.reverse, "sort in reverse (descending) order (z -> a)", NULL}, - /* default is to skip dups (messages with the same message-id); - * option left for backward compatibility */ - {"skip-dups", 'u', G_OPTION_FLAG_HIDDEN|G_OPTION_FLAG_REVERSE, - G_OPTION_ARG_NONE, &MU_CONFIG.include_dups, + {"skip-dups", 'u', 0, G_OPTION_ARG_NONE, + &MU_CONFIG.skip_dups, "show only the first of messages duplicates (false)", NULL}, - {"include-dups", 'u', 0, G_OPTION_ARG_NONE, - &MU_CONFIG.include_dups, - "do not skip all but the first message with some message-id", - NULL}, - /* default is to include related messages; option left for - * backward compatibility */ - {"include-related", 'r', G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_REVERSE, - G_OPTION_ARG_NONE, &MU_CONFIG.skip_related, - "include related messages in results", NULL}, - {"skip-related", 'r', 0, G_OPTION_ARG_NONE, - &MU_CONFIG.skip_related, - "do not include related messages in the results (false)", NULL}, - + {"include-related", 'r', 0, G_OPTION_ARG_NONE, + &MU_CONFIG.include_related, + "include related messages in results (false)", NULL}, {"linksdir", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.linksdir, "output as symbolic links to a target maildir", ""}, {"clearlinks", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.clearlinks, diff --git a/mu/mu-config.h b/mu/mu-config.h index 4192e4f1..2e86ead0 100644 --- a/mu/mu-config.h +++ b/mu/mu-config.h @@ -140,11 +140,12 @@ struct _MuConfig { gchar *exec; /* command to execute on the * files for the matched * messages */ - gboolean include_dups; /* if there are multiple messages with - * the same msgid, show all of them, - * not just the first */ - gboolean skip_related; /* do not include related messages in - * results */ + gboolean skip_dups; /* if there are multiple + * messages with the same + * msgid, show only the first + * one */ + gboolean include_related; /* included related messages + * in results */ /* for find and cind */ time_t after; /* only show messages or * addresses last seen after diff --git a/mu/tests/test-mu-cmd.c b/mu/tests/test-mu-cmd.c index 3163c2a6..c4c95a2c 100644 --- a/mu/tests/test-mu-cmd.c +++ b/mu/tests/test-mu-cmd.c @@ -88,7 +88,7 @@ search (const char* query, unsigned expected) { gchar *cmdline, *output, *erroutput; - cmdline = g_strdup_printf ("%s find --muhome=%s %s --skip-related --include-dups", + cmdline = g_strdup_printf ("%s find --muhome=%s %s", MU_PROGRAM, DBPATH, query); if (g_test_verbose())