From: Junio C Hamano <gitster@pobox•com>
To: "Jörg Thalheim" <joerg@thalheim•io>
Cc: git@vger•kernel.org, Aditya Garg <gargaditya08@live•com>
Subject: Re: [PATCH] imap-send: improve error messages for missing configuration
Date: Thu, 19 Jun 2025 17:58:32 -0700 [thread overview]
Message-ID: <xmqq7c178c07.fsf@gitster.g> (raw)
In-Reply-To: <8af387d5007b15cce49c924104d0e88522812e42@thalheim.io> ("Jörg Thalheim"'s message of "Thu, 19 Jun 2025 08:53:35 +0000")
"Jörg Thalheim" <joerg@thalheim•io> writes:
> The error message 'no imap store specified' was confusing because
> it referred to 'store' when the actual missing configuration was
> 'imap.folder'. Similarly, the host error message provided no
> guidance on how to fix the issue.
>
> Improve both error messages to:
> - Clearly state what configuration is missing
> - Provide hints showing the exact git config commands needed
> - Include examples of typical values
>
> This helps users quickly understand and resolve configuration issues
> when using git imap-send.
>
> Signed-off-by: Jörg Thalheim <joerg@thalheim•io>
> ---
> imap-send.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
It is curious that you are sending usability improvement patches to
imap-send, which I was recently told to be completely broken wrt the
use of imap.folder. Is the claim I heard that it is totally broken
not true after all, I wonder?
In any case, there are some patches in flight that rewrites the
parts of the program this patch wants to update (which addresses
that "completely broken" part and makes the program usable again).
Can you fix the messages on top of that work? By doing
$ git checkout --detach origin/master
$ git merge --no-ff -m 'Merge ag/imap-send-resurrection' adbc0b5d
$ git checkout -b jt/imap-send-error-message-fix
you can prepare the ground and then fix the messages there.
You might want to consider using the advise() API to add the hints,
and please make that a separate patch on top of the "What's imap
store? We call it a folder!" patch.
Thanks.
> diff --git a/imap-send.c b/imap-send.c
> index 2e812f5a6e..a2d6f6d3f6 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -1539,13 +1539,17 @@ int cmd_main(int argc, const char **argv)
> server.port = server.use_ssl ? 993 : 143;
>
> if (!server.folder) {
> - fprintf(stderr, "no imap store specified\n");
> + fprintf(stderr, "error: no imap folder specified\n");
> + fprintf(stderr, "hint: set the target folder with 'git config imap.folder <folder>'\n");
> + fprintf(stderr, " (e.g., 'git config imap.folder Drafts')\n");
> ret = 1;
> goto out;
> }
> if (!server.host) {
> if (!server.tunnel) {
> - fprintf(stderr, "no imap host specified\n");
> + fprintf(stderr, "error: no imap host specified\n");
> + fprintf(stderr, "hint: set the imap host with 'git config imap.host <host>'\n");
> + fprintf(stderr, " (e.g., 'git config imap.host imaps://imap.example.com')\n");
> ret = 1;
> goto out;
> }
next prev parent reply other threads:[~2025-06-20 0:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 8:53 [PATCH] imap-send: improve error messages for missing configuration Jörg Thalheim
2025-06-20 0:58 ` Junio C Hamano [this message]
2025-06-20 5:03 ` Aditya Garg
2025-06-20 5:05 ` Aditya Garg
2025-06-20 6:38 ` [PATCH v2 0/2] " Joerg Thalheim
2025-06-20 6:38 ` [PATCH v2 1/2] imap-send: fix confusing 'store' terminology in error message Joerg Thalheim
2025-06-20 6:38 ` [PATCH v2 2/2] imap-send: improve error messages with configuration hints Joerg Thalheim
2025-06-20 15:44 ` Junio C Hamano
2025-06-20 15:56 ` [PATCH v3 0/2] imap-send: improve error messages for missing configuration Joerg Thalheim
2025-06-20 15:56 ` [PATCH v3 1/2] imap-send: fix confusing 'store' terminology in error message Joerg Thalheim
2025-06-20 15:56 ` [PATCH v3 2/2] imap-send: improve error messages with configuration hints Joerg Thalheim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq7c178c07.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=gargaditya08@live$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=joerg@thalheim$(echo .)io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox