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

Re: [RFC] git blame-tree

From
Jeff King <peff@peff.net>
Date
Mar 2, 2011, 21:41 UTC
Message-ID
<20110302214142.GH20400@sigill.intra.peff.net>
In-Reply-To
<AANLkTi=hqVcGw16q6uJBO5kPjKtsa=ujtQxg4FRj_+i6@mail.gmail.com>
On Wed, Mar 02, 2011 at 10:24:29PM +0100, Piotr Krukowiecki wrote:
Show 7 quoted lines
> So it's like this?
> 
> B1
> |
> M - B2
> |
> P <- changes foo
Yes.
Show 6 quoted lines
> > What do we output? Both branches have equal claim to the commit.
> 
> That's easy. In "show only differences" we don't show anything,
> because on both branches last-change-commit of "foo" is the same.
> In "show all" last-change-commit is P so show it (with message like
> "changed in common root" or whatever).

Ah, that is totally not the output I would have expected. But now I understand a little better what you are talking about. In the former case, you are interested in a blame traversal going to the merge-base of branch1 and branch2, and you are interested in the source. So I think you could do it with something like:

  git blame-tree dir --left-right branch1...branch2

though of course the current output doesn't actually notice things like left-right markings from the revision traversal machinery.

And then there is also the question of representing greater than two branches. If "foo" blames to a commit that is in branch1 and branch2, but not branch3, what should be output? Presumably you would want it enumerated as "branch1 and branch2 touched it in commit X, branch three touched it in commit Y". But I'm not sure how well git's revision machinery tracks more than two sources.

> I think this is simple, but maybe I don't understand some git
> internals that make it hard.

I think it is possible, and probably would build on top of the work I am doing. But I am going to try to get the basics right first, and then we can see about building other stuff on top.

-Peff
Previous: Piotr KrukowieckiNext: Junio C Hamano
Message 8 of 17 in “[RFC] git blame-tree”
  1. Jeff KingMar 2, 2011
  2. Jeff KingMar 2, 2011
  3. Piotr KrukowieckiMar 2, 2011
  4. Jeff KingMar 2, 2011
  5. Piotr KrukowieckiMar 2, 2011
  6. Jeff KingMar 2, 2011
  7. Piotr KrukowieckiMar 2, 2011
  8. Jeff KingMar 2, 2011
  9. Junio C HamanoMar 2, 2011
  10. Jeff KingMar 2, 2011
  11. Junio C HamanoMar 2, 2011
  12. Jeff KingMar 3, 2011
  13. Ryan TomaykoMar 5, 2011
  14. Jakub NarebskiMar 3, 2011
  15. Jeff KingMar 2, 2011
  16. Will PalmerMar 4, 2011
  17. Jeff KingMar 4, 2011

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.