Skip to content

Commit

Permalink
diffcore-pickaxe: make error messages more consistent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed Jun 3, 2013
1 parent edca415 commit 276b22d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diffcore-pickaxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 276b22d

Please sign in to comment.