]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diffcore-pickaxe: make error messages more consistent
authorRamkumar Ramachandra <artagnon@gmail.com>
Fri, 31 May 2013 12:12:14 +0000 (17:42 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Jun 2013 17:50:22 +0000 (10:50 -0700)
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'
    fatal: invalid log-grep regex: Invalid back reference

This "log-grep" was only an internal name for the -G feature during
development, and invite confusion with "git log --grep=<pattern>".

Change the error messages to say "invalid regex".

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-pickaxe.c

index 63722f86dca4c00389d6f305fd8aa1af8ef8ed6c..c97ac9b463fc1248b2dfe70d5fdf1dc1679e2bf8 100644 (file)
@@ -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 {