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

bug: git log --follow does not honour --author option

From
JEJaap Eldering <jaap@jaapeldering.nl>
Date
Jan 13, 2022, 11:58 UTC
Message-ID
<d4bf0749-82f4-2d76-c36c-334a8a19abdf@jaapeldering.nl>
Hi,
I ran into this issue, see the output from git bugreport below. I first found it in version 2.30.2 from Debian Bullseye, but was able reproduce it also with a build from the next branch.

Best, Jaap

What did you do before the bug happened? (Steps to reproduce your issue)
A minimal working example reproducing the bug:

git init test-log-follow-author cd test-log-follow-author echo "Some contents." > foo git add foo git commit -m "Initial commit." --author "Myself <myself@example.com>" git mv foo bar git commit -m "Let's rename this." --author "Random other person <random@example.com>" git log --follow --author myself -- bar

What did you expect to happen? (Expected behavior)

I expected the last git log command to show the initial commit made by myself.

What happened instead? (Actual behavior)
No commits show up.
What's different between what you expected and what actually happened?

The --author option doesn't seem to find commits across renames when using --follow, except for when searching the author who renamed the file: these are found, and all commits also show up as expected when no --author argument is used.

Anything else you want to add:

[System Info] git version: git version 2.35.0.rc0.227.g00780c9af4 cpu: x86_64 built from commit: 00780c9af44409a68481c82f63a97bd18bb2593e sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.31 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]
Message 1 of 1 in “bug: git log --follow does not honour --author option”
  1. Jaap ElderingJan 13, 2022

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.