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

Re: Blamming a diff between two commits?

From
JHJan Hudec <bulb@ucw.cz>
Date
Feb 22, 2009, 12:32 UTC
Message-ID
<20090222123248.GA6504@efreet.light.src>
In-Reply-To
<499AB8A1.7090909@datacom.ind.br>
On Tue, Feb 17, 2009 at 10:16:17 -0300, Samuel Lucas Vaz de Mello wrote:
Show 24 quoted lines
> Hi,
> 
> Is there any way to git blame (or annotate) a diff between two commits?
> 
> I'm looking for something that produce something like this:
> 
>                               /**
> 85a02065 (samuel 2009-01-02) - * \brief      Define a participacao da porta estatica/dinamica
> 85a02065 (samuel 2009-01-02) - * \param      unit            indice da unidade
> e106303a (arthur 2009-01-17) - * \param	     extraparam      extra parameter
> 85a02065 (samuel 2009-01-02) - * \param      port            indice da porta
> 50e22e7d (fabian 2009-01-09) - * \param      deleted         param to be deleted
> 85a02065 (samuel 2009-01-02) + * \brief      Sets port membership on a static / dynamic 
> 85a02065 (samuel 2009-01-02) + * \param      unit            unit index
> 85a02065 (samuel 2009-01-02) + * \param      port            port index
> e106303a (arthur 2009-01-17) + * \param	     another         another index
>                                * \return     0 if Ok; -1 in error
>                                */
> 
> This would be useful for code reviews. I can use a diff containing all changes committed to a branch, for example, in the last 10 days to review. Doing this instead of reviewing individual commit patches save us from waste time analyzing code that has already been changed/fixed. 
> 
> Using a git-blame in the resulting file give me the commits for the lines added, but not for the deleted ones.
> 
> Any suggestion on how to do this?

What about doing a diff of the blames? It should do the same thing (except the +/- would be at the begining of the lines). Well, not exactly, because if there was a change, that was reverted again, blames would change, so it would appear here, but that's probably rare enough to ignore (if you don't even want to see it rather than not).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Thomas RastNext: Matthieu Moy
Message 8 of 10 in “Blamming a diff between two commits?”
  1. Samuel Lucas Vaz de MelloFeb 17, 2009
  2. Johannes SchindelinFeb 17, 2009
  3. Samuel Lucas Vaz de MelloFeb 17, 2009
  4. Johannes SchindelinFeb 17, 2009
  5. Matthieu MoyFeb 17, 2009
  6. Thomas RastFeb 17, 2009
  7. Thomas RastFeb 20, 2009
  8. Jan HudecFeb 22, 2009
  9. Matthieu MoyFeb 22, 2009
  10. Jan HudecFeb 22, 2009

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.