Will Palmer [off-list ref] writes:
-static struct cmt_fmt_map *find_commit_format(const char *sought)
+static struct cmt_fmt_map *find_commit_format_recursive(const char *sought,
+ int num_redirections)
{
struct cmt_fmt_map *found = NULL;
size_t found_match_len;
int i;
- if (!commit_formats)
- setup_commit_formats();
+ if (num_redirections >= commit_formats_len)
+ return NULL;
Nice trick to avoid a loopy definition chain.
I however wonder if we would want to be more helpful to the users to
diagnose this error by saying something here with error(), instead of just
letting the caller say "invalid --pretty format: %s".