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

Re: Git blame only current branch

From
Aandreas.t.auer_gtml_37453@ursus.ath.cx <andreas.t.auer_gtml_37453@ursus.ath.cx>
Date
Dec 12, 2011, 17:19 UTC
Message-ID
<4EE63799.6020409@ursus.ath.cx>
In-Reply-To
<5e2440c1-8d11-4d92-b42f-14169a62ced1@mail>
On 12.12.2011 18:05 Stephen Bash wrote:
Show 21 quoted lines
>  ----- Original Message -----
> > From: "Jeff King" <peff@peff.net> Sent: Monday, December 12, 2011
> > 11:55:42 AM Subject: Re: Git blame only current branch
> >
> > On Mon, Dec 12, 2011 at 10:24:47AM -0500, Stephen Bash wrote:
> >
> > Usually when you are interested in seeing merges like this in
> > git-log, you would use one of "--first-parent" or "--merges".
> > However, though "git blame" takes revision arguments, it does its
> > own traversal of the graph that does not respect those options.
>
>  My first thought was --first-parent, and was disappointed when I
>  didn't find it in the blame documentation :)  I think for my purposes
>  --first-parent is better than --merges because there are non-merge
>  commits on the branch(es) of interest (and thus I think the problem
>  would become ill-posed in the --merges case).
>
> > Modifying it to do --first-parent is pretty easy: ... snip ...
>
>  That's pretty simple...  I'll try to do a little testing this
>  afternoon.

You might need to consider that if the master branch was first merged into topicA before topicA was merged back to the master that the master would only be fast-forwarded and so the first parent of M would be 3 not C. So depending how the developers merged you might get different results.

Previous: Stephen BashNext: Vijay Lakshminarayanan
Message 4 of 10 in “Git blame only current branch”
  1. Stephen BashDec 12, 2011
  2. Jeff KingDec 12, 2011
  3. Stephen BashDec 12, 2011
  4. andreas.t.auer_gtml_37453@ursus.ath.cxDec 12, 2011
  5. Vijay LakshminarayananDec 13, 2011
  6. Jeff KingDec 13, 2011
  7. Junio C HamanoDec 13, 2011
  8. Vijay LakshminarayananDec 13, 2011
  9. Frans KlaverDec 13, 2011
  10. Junio C HamanoDec 13, 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.