Re: [PATCH] tag: add --author option

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

 



Zbigniew Jędrzejewski-Szmek  <zbyszek@xxxxxxxxx> writes:

>> +	if (force_author) {
>> +		const char *lb = strstr(force_author, "<");
>> +		const char *rb = strchr(force_author, '>');
>> +
>> +		if (!lb || !rb)
>> +			die(_("malformed --author parameter"));
>> +			name = xstrndup(force_author, lb - force_author);
>> +			email = xstrndup(lb + 2, rb - (lb + 2));
>
> This part is identical to builtin/commit.c, it would be nice to
> refactor it into a function.

Or we may want to use something like split_ident_line() from 4b340cf
(ident.c: add split_ident_line() to parse formatted ident line,
2012-03-11) to consolidate the parsing of this kind of stuff even further.
--
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]