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

Re: Why is AuthorDate displayed on git-blame?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2020, 00:40 UTC
Message-ID
<xmqq5z9yq611.fsf@gitster.c.googlers.com>
In-Reply-To
<CAAWR3A9po-zMVFdQfDs6R5F_rf0UvSyfByLj-vYZiXLb8+j4Ug@mail.gmail.com>
נעם סולוביצ'יק  <inoamsol@gmail.com> writes:
Show 12 quoted lines
> A feature branch having commits authored last week, but merged to the
> main branch just today. And to the sake of discussion, let's say that
> the branch has a bug.
>
> When someone encounters the bug on the main branch, he would probably
> want to know when it was introduced - the date when the bug started
> to affect him. However, git-blame only shows him when the bug was
> originally authored, in our case - *last-week*, which is confusing
> since the main branch was working just fine back then.
>
> So I wonder why was AuthorDate the date chosen to be displayed under
> git-blame?

Quite honestly, the left-hand side of "git blame" output is not all that useful, as the usual workflow is to use "blame" to only to identify a commit (or a set of commits) and from there, any detailed information of problematic commits will be inspected with "git show" or equivalent, so in that sense, "git blame -s" could be the most useful output format.

It should be trivial to add an option to show the commit date instead, so in that sense, the answer to the immediate question "why author date?" is "just because we chose to show it; you are welcome to send in a patch to add an option to show committer date".

However, your question has another ingredient that is much more interesting. If you are interested only at the level of changes to the primary integration branch, showing either author or committer date of the ultimately responsible individual commit that was brought in by a merge of a topic branch to the integration branch is not useful at all for your purpose. You need to find out which merge brought the change to the integraiton branch and you do not care which individual commit on the side branch that was merged.

IOW, what you would want is a "git blame --first-parent".
Previous: נעם סולוביצ'יקNext: Raymond E. Pasco
Message 2 of 10 in “Why is AuthorDate displayed on git-blame?”
  1. נעם סולוביצ'יקAug 5, 2020
  2. Junio C HamanoAug 5, 2020
  3. Raymond E. PascoAug 6, 2020
  4. Noam SoloveichikAug 6, 2020
  5. Raymond E. PascoAug 6, 2020
  6. Junio C HamanoAug 6, 2020
  7. blame-options.txt: document --first-parent optionRaymond E. Pasco, Aug 6, 2020
  8. Jeff KingAug 8, 2020
  9. brian m. carlsonAug 5, 2020
  10. Junio C HamanoAug 5, 2020

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.