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

Re: [PATCH] blame: draft of line format

From
Jeff King <peff@peff.net>
Date
Jan 31, 2017, 19:41 UTC
Message-ID
<20170131194138.fbcbdnkfjgizxnoa@sigill.intra.peff.net>
In-Reply-To
<20170131022830.8538-1-eantoranz@gmail.com>
On Mon, Jan 30, 2017 at 08:28:30PM -0600, Edmundo Carmona Antoranz wrote:
Show 12 quoted lines
> +static void pretty_info(char* revid, struct blame_entry *ent, struct strbuf *rev_buffer)
> +{
> +	struct pretty_print_context ctx = {0};
> +	struct rev_info rev;
> +
> +	struct strbuf format = STRBUF_INIT;
> +	strbuf_addstr(&format, format_line);
> +	ctx.fmt = CMIT_FMT_USERFORMAT;
> +	get_commit_format(format.buf, &rev);
> +	pretty_print_commit(&ctx, ent->suspect->commit, rev_buffer);
> +	strbuf_release(&format);
> +}

I think this may be less awkward if you use format_commit_message() as the entry point. Then you do not need a rev_info struct at all, it touches fewer global variables, etc.

I don't know if that would cause the other difficulties you mentioned, though.

-Peff
Previous: Edmundo Carmona AntoranzNext: Edmundo Carmona Antoranz
Message 3 of 4 in “blame: draft of line format”
  1. blame: draft of line formatEdmundo Carmona Antoranz, Jan 31, 2017
  2. Edmundo Carmona AntoranzJan 31, 2017
  3. Jeff KingJan 31, 2017
  4. Edmundo Carmona AntoranzMar 6, 2017

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.