git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] diffcore-pickaxe: make error messages more consistent

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 31, 2013, 12:12 UTC
Message-ID
<1370002335-6596-2-git-send-email-artagnon@gmail.com>
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
Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 2 of 5 in “Improve diffcore-pickaxe documentation”
  1. 0/2 Improve diffcore-pickaxe documentationRamkumar Ramachandra, May 31, 2013
  2. 1/2 diffcore-pickaxe: make error messages more consistentRamkumar Ramachandra, May 31, 2013
  3. Junio C HamanoJun 3, 2013
  4. 2/2 diffcore-pickaxe doc: document -S and -G properlyRamkumar Ramachandra, May 31, 2013
  5. Junio C HamanoJun 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.