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

Re: Ignored commits appearing in git blame

From
JÉJulien ÉLIE <julien@trigofacile.com>
Date
Jan 10, 2023, 21:09 UTC
Message-ID
<4c2d2581-5f69-6e42-73e8-9c64d9bad4bc@trigofacile.com>
In-Reply-To
<CAJDYR9RnWuO66i9aLdACox+GRSpidyWyZkS_2hHWH=1v2cfbtA@mail.gmail.com>
Hi Michael,
Thanks for having taken time to respond!
Show 5 quoted lines
> You're right, ideally 36944f2b16 should have disappeared from the
> output at line 5. The way the ignoring algorithm works is that it
> tries to find a line in the previous commit with similar content.
> Since there's so little content to compare I guess the algorithm plays
> it safe and gives up.
OK, I understand.
Show 5 quoted lines
> On the one hand this is annoying because an
> empty line or single curly brace should be trivial for the algorithm
> to deal with. On the other hand "which change caused this empty line
> to be here?" is not a very interesting question so hopefully won't be
> too much of a problem for you in practice.
I agree.
Show 5 quoted lines
> There are a couple of
> annoyances with the feature I'd like to fix (the main being that
> there's no way to enable it globally) and I'll add this to the list.
> However I'm unlikely to get to it soon. I won't complain if you beat
> me to fixing it :)

Thanks for having considered the bug report. In case it helps, I've noticed that if I add the "-w" flag (to ignore whitespace in comparisons), the git blame output no longer shows that revision which was asked to be ignored.

   git blame -w --ignore-revs-file .git-blame-ignore-revs radius.c

I don't know whether it is a coincidence (especially when .git-blame-ignore-revs contains in fact commits of code reformatting and whitespace cleaning) or it would also help for other kind of commits to ignore.

-- 
Julien ÉLIE

« Le bonheur, c'est de continuer à désirer ce que l'on possède. »
   (Saint-Augustin)
Previous: Michael Platings
Message 4 of 4 in “Ignored commits appearing in git blame”
  1. Julien ÉLIEJan 8, 2023
  2. Junio C HamanoJan 9, 2023
  3. Michael PlatingsJan 9, 2023
  4. Julien ÉLIEJan 10, 2023

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.