From 1d304ce1301f4bcc239683702e8d9e675f5f78f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 20 Jun 2025 17:56:13 +0200 Subject: [PATCH 1/2] imap-send: fix confusing 'store' terminology in error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error message 'no imap store specified' is misleading because it refers to 'store' when the actual missing configuration is 'imap.folder'. Update the message to use the correct terminology that matches the configuration variable name. This reduces confusion for users who might otherwise look for non-existent 'imap.store' configuration when they see this error. Signed-off-by: Jörg Thalheim Signed-off-by: Junio C Hamano --- imap-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imap-send.c b/imap-send.c index 603e3d6fbc..4b63d9ca41 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1824,7 +1824,7 @@ int cmd_main(int argc, const char **argv) } if (!server.folder) { - fprintf(stderr, "no IMAP store specified\n"); + fprintf(stderr, "no IMAP folder specified\n"); ret = 1; goto out; } From d30bf28d09d4d13ca7984d8593522be22f698f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 20 Jun 2025 17:56:14 +0200 Subject: [PATCH 2/2] imap-send: improve error messages with configuration hints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace basic error messages with more helpful ones that guide users on how to resolve configuration issues. When imap.host or imap.folder are missing, provide the exact git config commands needed to fix the problem, along with examples of typical values. Use the advise() API to display hints in a multi-line format with proper "hint:" prefixes for each line. Signed-off-by: Jörg Thalheim Signed-off-by: Junio C Hamano --- imap-send.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/imap-send.c b/imap-send.c index 4b63d9ca41..f5a656ac71 100644 --- a/imap-send.c +++ b/imap-send.c @@ -25,6 +25,7 @@ #define DISABLE_SIGN_COMPARE_WARNINGS #include "git-compat-util.h" +#include "advice.h" #include "config.h" #include "credential.h" #include "gettext.h" @@ -1804,7 +1805,9 @@ int cmd_main(int argc, const char **argv) if (!server.host) { if (!server.tunnel) { - fprintf(stderr, "no IMAP host specified\n"); + error(_("no IMAP host specified")); + advise(_("set the IMAP host with 'git config imap.host '.\n" + "(e.g., 'git config imap.host imaps://imap.example.com')")); ret = 1; goto out; } @@ -1824,7 +1827,9 @@ int cmd_main(int argc, const char **argv) } if (!server.folder) { - fprintf(stderr, "no IMAP folder specified\n"); + error(_("no IMAP folder specified")); + advise(_("set the target folder with 'git config imap.folder '.\n" + "(e.g., 'git config imap.folder Drafts')")); ret = 1; goto out; }