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 f86ed12eb3.
This commit is contained in:
Dirk-Jan C. Binnema 2019-12-28 07:48:06 +02:00
parent dea577297f
commit 8cef8ac69c
5 changed files with 24 additions and 35 deletions

View File

@ -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 parameter consists of multiple parts (as in the example) they are
treated as if there were a logical \fBand\fR between them. 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 .TP
\fB\-\-include\-dups\fR,\fB-u\fR by default, whenever there are multiple \fB\-\-skip\-dups\fR,\fB-u\fR whenever there are multiple messages with the
messages with the same name, only show the first one. This is useful if you have same name, only show the first one. This is useful if you have copies of the
copies of the same message, which is a common occurrence when using e.g. Gmail same message, which is a common occurrence when using e.g. Gmail together with
together with \fBofflineimap\fR. Use this option to turn that behavior off. \fBofflineimap\fR.
.TP .TP
\fB\-\-skip\-related\fR,\fB-r\fR by default, the results include messages being \fB\-\-include\-related\fR,\fB-r\fR also include messages being refered to by
refered to by the matched messages -- i.e.. include messages that are part of the matched messages -- i.e.. include messages that are part of the same
the same message thread as some matched messages. This is useful if you want message thread as some matched messages. This is useful if you want
Gmail-style 'conversations'. Note, finding these related messages make searches Gmail-style 'conversations'. Note, finding these related messages make
slightly slower. Use this option to turn that behavior off. searches slower.
.TP .TP
\fB\-t\fR, \fB\-\-threads\fR show messages in a 'threaded' format -- that is, \fB\-t\fR, \fB\-\-threads\fR show messages in a 'threaded' format -- that is,

View File

@ -131,9 +131,9 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts, GError **err)
qflags = MU_QUERY_FLAG_NONE; qflags = MU_QUERY_FLAG_NONE;
if (opts->reverse) if (opts->reverse)
qflags |= MU_QUERY_FLAG_DESCENDING; qflags |= MU_QUERY_FLAG_DESCENDING;
if (!opts->include_dups) if (opts->skip_dups)
qflags |= MU_QUERY_FLAG_SKIP_DUPS; qflags |= MU_QUERY_FLAG_SKIP_DUPS;
if (!opts->skip_related) if (opts->include_related)
qflags |= MU_QUERY_FLAG_INCLUDE_RELATED; qflags |= MU_QUERY_FLAG_INCLUDE_RELATED;
if (opts->threads) if (opts->threads)
qflags |= MU_QUERY_FLAG_THREADS; qflags |= MU_QUERY_FLAG_THREADS;

View File

@ -210,24 +210,12 @@ config_options_group_find (void)
"use a bookmarked query", "<bookmark>"}, "use a bookmarked query", "<bookmark>"},
{"reverse", 'z', 0, G_OPTION_ARG_NONE, &MU_CONFIG.reverse, {"reverse", 'z', 0, G_OPTION_ARG_NONE, &MU_CONFIG.reverse,
"sort in reverse (descending) order (z -> a)", NULL}, "sort in reverse (descending) order (z -> a)", NULL},
/* default is to skip dups (messages with the same message-id); {"skip-dups", 'u', 0, G_OPTION_ARG_NONE,
* option left for backward compatibility */ &MU_CONFIG.skip_dups,
{"skip-dups", 'u', G_OPTION_FLAG_HIDDEN|G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &MU_CONFIG.include_dups,
"show only the first of messages duplicates (false)", NULL}, "show only the first of messages duplicates (false)", NULL},
{"include-dups", 'u', 0, G_OPTION_ARG_NONE, {"include-related", 'r', 0, G_OPTION_ARG_NONE,
&MU_CONFIG.include_dups, &MU_CONFIG.include_related,
"do not skip all but the first message with some message-id", "include related messages in results (false)", NULL},
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},
{"linksdir", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.linksdir, {"linksdir", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.linksdir,
"output as symbolic links to a target maildir", "<dir>"}, "output as symbolic links to a target maildir", "<dir>"},
{"clearlinks", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.clearlinks, {"clearlinks", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.clearlinks,

View File

@ -140,11 +140,12 @@ struct _MuConfig {
gchar *exec; /* command to execute on the gchar *exec; /* command to execute on the
* files for the matched * files for the matched
* messages */ * messages */
gboolean include_dups; /* if there are multiple messages with gboolean skip_dups; /* if there are multiple
* the same msgid, show all of them, * messages with the same
* not just the first */ * msgid, show only the first
gboolean skip_related; /* do not include related messages in * one */
* results */ gboolean include_related; /* included related messages
* in results */
/* for find and cind */ /* for find and cind */
time_t after; /* only show messages or time_t after; /* only show messages or
* addresses last seen after * addresses last seen after

View File

@ -88,7 +88,7 @@ search (const char* query, unsigned expected)
{ {
gchar *cmdline, *output, *erroutput; 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); MU_PROGRAM, DBPATH, query);
if (g_test_verbose()) if (g_test_verbose())