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

Re: [RFC/PATCH] builtin/blame: darken redundant line information

From
Stefan Beller <sbeller@google.com>
Date
Jun 14, 2017, 00:33 UTC
Message-ID
<CAGZ79kaCGJicxhwwKC3QCSDWg_8U8X=3mPZT672fUje7f-tKKA@mail.gmail.com>
In-Reply-To
<20170613164256.1773a62d@twelve2.svl.corp.google.com>
On Tue, Jun 13, 2017 at 4:42 PM, Jonathan Tan <jonathantanmy@google.com> wrote:
Show 18 quoted lines
> On Mon, 12 Jun 2017 19:31:51 -0700
> Stefan Beller <sbeller@google.com> wrote:
>
>> When using git-blame lots of lines contain redundant information, for
>> example in hunks that consist of multiple lines, the metadata (commit name,
>> author, timezone) are repeated. A reader may not be interested in those,
>> so darken them. The darkening is not just based on hunk, but actually
>> takes the previous lines content for that field to compare to.
>>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>>
>>  Example output (blame of blame): http://i.imgur.com/0Y12p2f.png
>
> Looking at this image, how does blame decide what to dim? As it is, I see many
> identical timestamps (and also from the same commit) not being dimmed.
> (For example, see the very last line with "2013-01-05 ..." which is
> identical to the previous line, and I would expect that to be dimmed.)
The date dimming is broken (it is implemented separately as a hack :/)
> Also, my preference is to have all-or-nothing dimming (dim the whole
> line up to and including the time zone if nothing has changed, and dim
> nothing otherwise) but I know that this is a subjective issue.
ok, noted.

That is what I had as a very first design (except for dimming, blanking out the lines with white spaces) and then went on "dimming even more".

I think this is also very similar to the discussion of boundary colors of the moved blocks in the neighboring thread, this is finding "blocks" (actually the finding part is easy as we are given the blocks) and then applying some "dim middle, highlight boundaries" algorithm, which in this particular case is a "highlight first line, dim the rest" for each field separately.

Originally I dreamed more a Zebra-style non-boundary coloring, the colors being temperature (https://en.wikipedia.org/wiki/Color_temperature) and the recency dictating the temperature, such that you can easily see which code is "hot" (i.e. modified recently)

Going by that I we could have different definitions of hotness:
* recency
* number of patches on a given line though that is hard to estimate
  when a line was changed vs newly-introduced
* number of different authors in a given function (= block of text with
  the same context hint in a virtual hunk header)
Previous: Jonathan TanNext: Stefan Beller
Message 14 of 19 in “builtin/blame: darken redundant line information”
  1. builtin/blame: darken redundant line informationStefan Beller, Jun 13, 2017
  2. Junio C HamanoJun 13, 2017
  3. Stefan BellerJun 13, 2017
  4. Junio C HamanoJun 13, 2017
  5. Stefan BellerJun 13, 2017
  6. Junio C HamanoJun 13, 2017
  7. Stefan BellerJun 13, 2017
  8. Junio C HamanoJun 13, 2017
  9. Stefan BellerJun 13, 2017
  10. Junio C HamanoJun 13, 2017
  11. Stefan BellerJun 13, 2017
  12. Junio C HamanoJun 13, 2017
  13. Jonathan TanJun 13, 2017
  14. Stefan BellerJun 14, 2017
  15. [PATCHv2] builtin/blame: highlight interesting thingsStefan Beller, Jul 26, 2017
  16. Junio C HamanoJul 26, 2017
  17. Stefan BellerJul 26, 2017
  18. Junio C HamanoJul 27, 2017
  19. Stefan BellerJul 27, 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.