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

Re: [Feature Request] git blame showing only revisions from git rev-list --first-parent

From
Max Kirillov <max@max630.net>
Date
Oct 18, 2015, 11:38 UTC
Message-ID
<20151018113857.GA5722@wheezy.local>
In-Reply-To
<20150915100538.GA21831@sigill.intra.peff.net>
On Tue, Sep 15, 2015 at 06:05:39AM -0400, Jeff King wrote:
> It seems like nobody is actually that interested in what "blame
> --first-parent --reverse" does in the first place, though, and there's
> no reason for its complexity to hold up vanilla --first-parent. So what
> do you think of:
...
Show 6 quoted lines
> Combining "--reverse" with "--first-parent" is more
> complicated, and will probably involve cooperation from
> revision.c. Since the desired semantics are not even clear,
> let's punt on this for now, but explicitly disallow it to
> avoid confusing users (this is not really a regression,
> since it did something nonsensical before).
Hi.

I might be late for this discussion, but I seem to have a case when blame --reverse --first-parent seems to work.

Consider the folowing history (from left ro right):
       +-----------------D1-+
      +--->C1------>C2-+     \
     /                  \     \
A0->A1-------->A2---..-->A3-->A4-->A5
 \            /
  +->B1-->B2-+

, and a line was removed in B2. Then, blame --reverse returns D1 for this line, which is, while technically correct, absolutely useless to find real place where the line was removed. But blame --reverse --first-parent seems to return A1, which is much more useful and actually what I would expect to return. I tried it recently with 2.3-something and it seems to work as expected.

Was it the behavior you mentioned as nonsensical or you have some other examples?

So please may I ask to not kill this completely. As about the issue mentioned by Junio, it could fail loudly if the requested range is not a first-parent chain.

-- 
Max
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 16 in “[Feature Request] git blame showing only revisions from git rev-list --first-parent”
  1. Stephen ConnollySep 11, 2015
  2. Jeff KingSep 11, 2015
  3. Stephen ConnollySep 11, 2015
  4. Junio C HamanoSep 11, 2015
  5. Junio C HamanoSep 11, 2015
  6. Jeff KingSep 12, 2015
  7. Junio C HamanoSep 12, 2015
  8. Philip OakleySep 12, 2015
  9. Jeff KingSep 13, 2015
  10. Junio C HamanoSep 14, 2015
  11. Jeff KingSep 15, 2015
  12. Junio C HamanoSep 16, 2015
  13. Jeff KingSep 16, 2015
  14. Junio C HamanoSep 17, 2015
  15. Max KirillovOct 18, 2015
  16. Junio C HamanoOct 18, 2015

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.