Thread (15 messages) flat view 15 messages, 3 authors, 2016-06-15

Re: [PATCH v3 4/5] pretty: add infrastructure to allow format aliases

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:44

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".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help