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

Re: Why is AuthorDate displayed on git-blame?

From
Raymond E. Pasco <ray@ameretat.dev>
Date
Aug 6, 2020, 18:13 UTC
Message-ID
<C4Q493FC0N34.3GA87TXK6SJPJ@ziyou>
In-Reply-To
<6dabe718-6d6e-e76c-677d-f2dc4a5b83be@gmail.com>
On Thu Aug 6, 2020 at 11:19 AM EDT, Noam Soloveichik wrote:
> I want to make sure I understand your proposal correctly -
> --first-parent would still show AuthorDate, but of the
> *merge-commit*, and not the commit that introduced the line of code
> to the history overall.

To be clear, I'm not proposing anything but surfacing a useful feature that already exists in the documentation.

> If so, it's going to get the job done for commits which are applied
> by a merge-commit. Although I wonder what --first-parent would
> display for commits which are applied *not* by a merge.

--first-parent commands don't care about merges, except that they never follow the second or later parents of a merge. blame just tries to find the earliest commit that had this version of some line in it; if it only follows first parents then that will often end up being a merge (if you're on an integration branch) but doesn't have to be.

Show 6 quoted lines
> Consider the linux kernel, where some of its commits are merge
> commits from pull requests, and some are applied patches: with
> different AuthorDate and CommitDate. For those commits, AuthorDate
> represents the date the patch was originally sent to review, not when
> it was introduced to the integration branch, which is represented by
> the CommitDate, which leads to inconsistencies.

I honestly don't make use of dates in my workflow at all, so I don't really have an opinion on date issues. The author date is marginally more interesting to me, but only marginally and only really in projects that use email (where the author date "git am" records is the date on the email the patch came in).

Of course an option to choose which author/date pair (author or committer) to annotate the file with would be a fine addition benefiting people who do look at the dates. I use first-parent histories all the time, however, and I'd like to see this useful existing blame option documented.

Previous: Noam SoloveichikNext: Junio C Hamano
Message 5 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.