From: Junio C Hamano Date: Sun, 02 May 2010 03:13:15 GMT Subject: Re: [PATCH v3 4/5] pretty: add infrastructure to allow format aliases Message-ID: <7vhbmryp10.fsf@alter.siamese.dyndns.org> In-Reply-To: <1272656128-2002-5-git-send-email-wmpalmer@gmail.com> Will Palmer 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".