git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 27, 2012, 20:42 UTC
Message-ID
<7vvclphj2x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F71F902.8090200@in.waw.pl>
Zbigniew Jędrzejewski-Szmek  <zbyszek@in.waw.pl> writes:
Show 11 quoted lines
>> +	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.

Previous: Junio C Hamano
Message 7 of 7 in “tag: add --author option”
  1. tag: add --author optionMathias Weber, Mar 27, 2012
  2. Zbigniew Jędrzejewski-SzmekMar 27, 2012
  3. Mathias WeberMar 27, 2012
  4. Junio C HamanoMar 27, 2012
  5. Mathias WeberMar 27, 2012
  6. Junio C HamanoMar 27, 2012
  7. Junio C HamanoMar 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.