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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will Palmer <wmpalmer@xxxxxxxxx> 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".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]