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

Re: [PATCH 1/1] blame: remove unnecessary use of get_commit_info()

From
Taylor Blau <me@ttaylorr.com>
Date
Feb 16, 2021, 17:10 UTC
Message-ID
<YCv8nvJ6faO7esoj@nand.local>
In-Reply-To
<20210216163151.76307-2-rafaeloliveira.cs@gmail.com>
On Tue, Feb 16, 2021 at 05:31:51PM +0100, Rafael Silva wrote:
Show 5 quoted lines
> When `git blame --color-by-age`, the determine_line_heat() is called to
> select how to color the output based on the commit author's date.  It
> uses the get_commit_info() to parse the information into a `commit_info`
> structure, however, this is actually unnecessary because the
> determine_line_heat() caller also does the same.

Interesting. It looks like this micro-optimization could have been safely performed as early as 25d5f52901 (builtin/blame: highlight recently changed lines, 2018-04-23), which is when this feature was originally introduced.

I looked at 25d5f52901 to see if there was any reason that we didn't at the time, but couldn't find anything.

So this looks correct to me. I'm a little disappointed that some of your more detailed performance numbers from the cover letter didn't make it into the patch description, but it may not be worth belaboring the point further.

    Reviewed-by: Taylor Blau <me@ttaylorr.com>

Thanks, Taylor

Previous: Rafael SilvaNext: Rafael Silva
Message 3 of 9 in “blame: remove unnecessary use of get_commit_info()”
  1. 0/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 16, 2021
  2. 1/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 16, 2021
  3. Taylor BlauFeb 16, 2021
  4. Rafael SilvaFeb 16, 2021
  5. Derrick StoleeFeb 16, 2021
  6. Junio C HamanoFeb 16, 2021
  7. Rafael SilvaFeb 17, 2021
  8. 0/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 17, 2021
  9. 1/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 17, 2021

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.