From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] diffcore-pickaxe: make error messages more consistent
Date: Tue, 14 May 2013 10:46:12 -0700 [thread overview]
Message-ID: <7vsj1pjvyz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1368540973-25830-1-git-send-email-artagnon@gmail.com> (Ramkumar Ramachandra's message of "Tue, 14 May 2013 19:46:13 +0530")
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> Currently, diffcore-pickaxe reports two distinct errors for the same
> user error:
>
> $ git log --pickaxe-regex -S'\1'
> fatal: invalid pickaxe regex: Invalid back reference
>
> $ git log -G'\1' # --pickaxe-regex is implied
> fatal: invalid log-grep regex: Invalid back reference
>
> Since the error has nothing to do with "log-grep", change the -G error
> message to match the -S error message.
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
> Sorry I couldn't do more. diffcore-pickaxe.c isn't at all easy to
> hack on, because there are so few tests guarding it.
>
> diffcore-pickaxe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
> index 63722f8..d69a7a2 100644
> --- a/diffcore-pickaxe.c
> +++ b/diffcore-pickaxe.c
> @@ -122,7 +122,7 @@ static void diffcore_pickaxe_grep(struct diff_options *o)
> char errbuf[1024];
> regerror(err, ®ex, errbuf, 1024);
> regfree(®ex);
> - die("invalid log-grep regex: %s", errbuf);
> + die("invalid pickaxe regex: %s", errbuf);
> }
>
> pickaxe(&diff_queued_diff, o, ®ex, NULL, diff_grep);
I am debating myself if it is truly easier to explain for users that
"-G" is a different variant of pickaxe.
It happens to be implemented in the same source file as pickaxe, but
they do logically quite different things. -G does not even have a
reason to pay attention to --pickaxe-regexp (it is "grep in the log
-p").
I suspect that it might avoid unnecessary confusion to explain them
as totally separate operations, and not labelling this error with
"pickaxe regex". I dunno.
next prev parent reply other threads:[~2013-05-14 17:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 14:16 [PATCH] diffcore-pickaxe: make error messages more consistent Ramkumar Ramachandra
2013-05-14 17:46 ` Junio C Hamano [this message]
2013-05-14 18:15 ` Ramkumar Ramachandra
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=7vsj1pjvyz.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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