summaryrefslogtreecommitdiff
path: root/lib/utils
AgeCommit message (Collapse)Author
2026-04-10lib/utils: small cleanupsDirk-Jan C. Binnema
Fix some static analysis warnings
2026-04-10lib: remove unused async-queueDirk-Jan C. Binnema
2026-03-17mu-utils-file: use std::filesystem::remove_allDirk-Jan C. Binnema
Instead of the hacky "rm -rf"
2026-03-17mu-utils-file: remove some unused codeDirk-Jan C. Binnema
2026-03-07mu/lib: fix some possible quoting issuesDirk-Jan C. Binnema
2026-01-29mu-utils: replace #define with constexpr for MU_COLOR_Dirk-Jan C. Binnema
2026-01-28utils: fix typoDirk-Jan C. Binnema
2026-01-27utils: rework MU_ENABLE_BITOPS using C++20 codeDirk-Jan C. Binnema
Instead of macros, we using C++20 concepts to define the helpers to deal with bitops on enum-class conveniently. x# Please enter the commit message for your changes. Lines starting
2026-01-23sexp.hh: silence compiler warningsDirk-Jan C. Binnema
Seems they only happen in C++20 mode, not when compiling C++23 mode. So assuming these are false alarms (old code anyway)
2025-12-13utils: rework logging functionsDirk-Jan C. Binnema
Use a general mu_log which does the formatting, and specific mu_debug, mu_info etc., to call it.
2025-11-19test-utils: fix some clang-tidy warningsDirk-Jan C. Binnema
2025-11-19test-utils: use remove_directoryDirk-Jan C. Binnema
2025-11-19utils/file: rework remove_directory, add testDirk-Jan C. Binnema
Make remove_directory not much less ugly, but at least more robust, e.g., when the "rm" binary is not at /bin/rm Add unit test
2025-11-01logging: don't g_message with --quietDirk-Jan C. Binnema
When `--quiet` is passed (and not --debug), do not log with g_message at startup.
2025-10-25utils: add utf8_clean helperDirk-Jan C. Binnema
To morph text into valid utf8 if it isn't already.
2025-09-28utils: avoid fmt:gmtime/fmt::localtimeDirk-Jan C. Binnema
They've been deprecated and give build warnings with new enough libfmt.
2025-08-26Replace "the the " with "the "Anton Mosich
2025-08-24utils: add set_thread_nameDirk-Jan C. Binnema
With HAVE_PTHREAD_SETNAME_NP
2025-08-16mu-init: automatic export labels with --reinitDirk-Jan C. Binnema
When re-initializing the store, automatically write the labels to a file in mu's cache, so user can later import them.
2025-08-15tests: only build when neededDirk-Jan C. Binnema
Build the tests lazily, i.e., not before `meson test`. This helps with build-times.
2025-07-27utils: refactor count_nl from mu-cmd-findDirk-Jan C. Binnema
And update users. Please enter the commit message for your changes. Lines starting
2025-07-24fmt: prefer system package if foundDirk-Jan C. Binnema
mu embeds a "vendored" subset of the libfmt package under thirdparty; but it's better to use the system-package if the user has one. So, use the system package if found or user -Duse-embedded-fmt=true is specified.
2025-06-16mu-test: fix logging verbosityDirk-Jan C. Binnema
We were logging _everything since the g_log_set_handler was only set for the default domain, not "mu". Let's fix this.
2025-06-14mu_utils: add to_string_charDirk-Jan C. Binnema
Like to_string_gchar, but for malloc/free strings.
2025-05-24mu-test: add valgrind checkDirk-Jan C. Binnema
Make it a bit easier to skip some tests when running under valgrind.
2025-04-12mu-server: cleanup find prop handlingDirk-Jan C. Binnema
Rework the overly long find-handler. Improve parsing of options, and return better return properties (for use in mu4e).
2025-03-23mu-sexp: don't require > c++17Dirk-Jan C. Binnema
2025-03-23mu-find: implement format=json2Dirk-Jan C. Binnema
Implement a new experimental json2 format for mu-find, which gets rid of the ":" prefixes for fields, i.e., "subject" instead of ":subject". Document it as well.
2025-03-23mu-sexp: tighten definition of plistpDirk-Jan C. Binnema
In a plist, we also require the first of each two element pairs to start with ':' Fixes #2830.
2025-03-23mu-sexp: fix c++23 warning for suffix operatorDirk-Jan C. Binnema
Space between operator"" and _xxx is deprecated.
2024-12-09utils-file: add unit-test for expand_fileDirk-Jan C. Binnema
2024-12-07mu-sexp: add -unix output for json tstampsDirk-Jan C. Binnema
The json output (for mu-find etc.) just showed the converted sexp output, including the clumsy emacs-style tstamps (for changed/date). Add unix timestamps as well, which are easier to work with outside emacs. This handles #2770.
2024-12-06lib/utils: include fmt/xchar.hDirk-Jan C. Binnema
Needed for 'join'
2024-09-22Fix typos.James Cook
2024-08-26lib: use time_t_max for empty datetimeMatthew Smith
In Mu::parse_date_time, when provided with an empty string, return time_t_max instead of G_MAXINT64. For systems with a 64-bit time_t, there is no difference. With a 32-bit time_t it caused a test to fail: not ok /utils/date-basic - ERROR:../mu-1.12.4/lib/utils/tests/test-utils.cc:92 void test_date_basic(): assertion failed (parse_date_time(std::get<0>(test), std::get<1>(test)).value_or(-1) == std::get<2>(test)): (18446744073709551615 == 2147483647) This edge case probably only affected the test, as when other parts of the application call parse_date_time (e.g. mu-server.cc and mu-query-processor.cc), they check if the input string is empty first.
2024-05-07logging: rework a bit, maybe support syslogDirk-Jan C. Binnema
Seems journal logging fails on NetBSD (no surprise), but has some unwanted/not-fully-understood side-effects. In any case, outside Linux there's no use in even trying to use journald; so we don't do that anymore. Add conditional support for syslog (requires glib 2.80).
2024-04-21compat: include sys/wait.h where neededDirk-Jan C. Binnema
netbsd needs this explicitly, other systems let us get away without it.
2024-04-14test-mu-utils: update parse_date_time testsDirk-Jan C. Binnema
We're using ::time_t now.
2024-04-13mu-utils: update casting from int64_t -> time_tDirk-Jan C. Binnema
Esp. for systems with 32-bit time_t.
2024-04-08utils: build test-utils when tests are not disabledDirk-Jan C. Binnema
Fixes #2685
2024-04-06utils: only build mu-tests-utils when tests are enabledDirk-Jan C. Binnema
This fixes a compilation failure. Fixes #2684.
2024-04-01mu-utils: Fix build with muslMatthew Smith
In musl, `stdout` is a macro that expands to `(stdout)`, and `::(stdout)` is not valid C++. ../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected id-expression before '(' token 268 | ::stdout); | ^~~~~~ Nothing in the Mu namespace is named stdout, so it is safe to drop the `::`. Bug: https://bugs.gentoo.org/928361
2024-03-15clang: fix some compiler warningsDirk-Jan C. Binnema
From CI.
2024-02-25tests: check setlocale return valueDirk-Jan C. Binnema
It might fail while nl_langinfo does not.
2024-01-06tests: move to tests/, make optionalDirk-Jan C. Binnema
While not recommended, sometimes it can be useful to disable building the unit tests. This can be done now with meson -Dtests=disabled build
2024-01-01mu-init: guess maildir when --maildir is missingDirk-Jan C. Binnema
Re-instate the guessing that's in the manpage. Add unit tests. Update documentation. Fixes #2616.
2023-12-13mu-result: small tweaksDirk-Jan C. Binnema
2023-10-07expand_path: better handle paths with spacesDirk-Jan C. Binnema
I.e., work around surprising behavior of wordexp Fixes #2566.
2023-09-24maildir: improve unit testsDirk-Jan C. Binnema
And get some more info from run_command.
2023-09-24improve unit testsDirk-Jan C. Binnema