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

Re: Feature request: implement '--follow' option for `git blame`

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 13, 2015, 05:32 UTC
Message-ID
<xmqqiod04mq6.fsf@gitster.dls.corp.google.com>
In-Reply-To
<209433431.20150410094038@yandex.ru>
Eugen Konkov <kes-kes@yandex.ru> writes:
> I agree with your complex example.

Note that it is a norm, not anything complex, that we do not rename a file wholesale.

> But it will be great to guess in simple case, when in version v1.0
> only one file A which were renamed into C half year later.

So you used to have A and somebody renamed that into C in the past. The content of C in the current version is what you used to have in A.

What should happen if you also have A, whose contents do not have any relation to that old A, in today's code?

What should happen if you also used to have C, whose contents do not have any relation to that old A or current C?

What happens if you added such random guessing and you were not so familiar with the project history to know these unrelated A's and C's that used to exist in the past?

Current Git _consistently_ behaves, even in the presense of anything that can lead to confusing behaviour. When you ask

    git blame OLD -- A

it does not matter if you have an unrelated A in the revision that you happen to have checked out in your working tree (i.e. HEAD). The above command line talks about the old revision OLD and A talks about the path A in that old revision.

Previous: Eugen KonkovNext: Eugen Konkov
Message 5 of 6 in “Feature request: implement '--follow' option for `git blame`”
  1. KESApr 6, 2015
  2. Fwd: Feature request: implement '--follow' option for `git blame`KES, Apr 7, 2015
  3. Junio C HamanoApr 8, 2015
  4. Re[2]: Feature request: implement '--follow' option for `git blame`Eugen Konkov, Apr 10, 2015
  5. Junio C HamanoApr 13, 2015
  6. Re[2]: Feature request: implement '--follow' option for `git blame`Eugen Konkov, Apr 13, 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.