It looks like this failure is caused because it's not possible to directly check errors from the compile_grep_patterns [1] git function called in cgit_print_log [2]. The compile_grep_patterns function calls compile_regexp [3] which can call exit. See the following relevant lines from compile_regexp:

```
    err = regcomp(&p->regexp, p->pattern, regflags);
    if (err) {
        char errbuf[1024];
        regerror(err, &p->regexp, errbuf, 1024);
        compile_regexp_failed(p, errbuf);
    }
```

I think getting cgit to return an informational page here would require launching a separate process or changing the upstream git function to allow non-fatal failures.

1. https://gitlab.com/git-scm/git/-/blob/HEAD/grep.c#L770
2. https://git.zx2c4.com/cgit/tree/ui-log.c#n454
3. https://gitlab.com/git-scm/git/-/blob/HEAD/grep.c#L492

--
Aiden Woodruff


Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to