How to find out who was the author of the deleted line?

Suppose I have a specific commit in git that contains some line deletes. How easy is it to check who created deleted rows?

Now I do the following:

git blame THE_FILE.TXT THE_REVISION^

which annotates all the lines as they were before the change. This requires manual scrolling, and the search strings that I know are removed in the next commit.

Is there a better way to only annotate changed lines (displayed git showor git diff)?

This is not about when a particular line was deleted (as in another question), but the opposite was done - a search when a deleted line was entered. There is no answer yet.

Example:

https://github.com/torvalds/linux/commit/d6d211db37e75de2ddc3a4f979038c40df7cc79c#diff-b67911656ef5d18c4ae36cb6741b7965L4

The problem is to easily identify the commit that entered the line "EXTRAVERSION = -rc4", which is now deleted.

+4
source share
1 answer

You can limit to a git-blamegiven range of lines using the parameter -L. Since the line number may differ in THE_REVISION^, I suggest using -L :<regex>instead of a range of line numbers.

+2
source

Source: https://habr.com/ru/post/1539912/


All Articles