git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 1/2] diffcore-pickaxe: make error messages more consistent
Date: Fri, 31 May 2013 17:42:14 +0530	[thread overview]
Message-ID: <1370002335-6596-2-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1370002335-6596-1-git-send-email-artagnon@gmail.com>

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 and -S
error messages to say "invalid regex".

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 diffcore-pickaxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index 63722f8..c97ac9b 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, &regex, errbuf, 1024);
 		regfree(&regex);
-		die("invalid log-grep regex: %s", errbuf);
+		die("invalid regex: %s", errbuf);
 	}
 
 	pickaxe(&diff_queued_diff, o, &regex, NULL, diff_grep);
@@ -246,7 +246,7 @@ static void diffcore_pickaxe_count(struct diff_options *o)
 			char errbuf[1024];
 			regerror(err, &regex, errbuf, 1024);
 			regfree(&regex);
-			die("invalid pickaxe regex: %s", errbuf);
+			die("invalid regex: %s", errbuf);
 		}
 		regexp = &regex;
 	} else {
-- 
1.8.3.114.gcd03571

  reply	other threads:[~2013-05-31 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 12:12 [PATCH v4 0/2] Improve diffcore-pickaxe documentation Ramkumar Ramachandra
2013-05-31 12:12 ` Ramkumar Ramachandra [this message]
2013-06-03 17:52   ` [PATCH 1/2] diffcore-pickaxe: make error messages more consistent Junio C Hamano
2013-05-31 12:12 ` [PATCH 2/2] diffcore-pickaxe doc: document -S and -G properly Ramkumar Ramachandra
2013-06-03 17:54   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2013-05-24 10:33 [PATCH v3 0/2] Improve diffcore-pickaxe documentation Ramkumar Ramachandra
2013-05-24 10:33 ` [PATCH 1/2] diffcore-pickaxe: make error messages more consistent Ramkumar Ramachandra
2013-05-17 12:23 [PATCH v2 0/2] Improve diffcore-pickaxe documentation Ramkumar Ramachandra
2013-05-17 12:23 ` [PATCH 1/2] diffcore-pickaxe: make error messages more consistent Ramkumar Ramachandra
2013-05-18  1:25   ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370002335-6596-2-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).