On Mon, Oct 12, 2015 at 11:49:42AM +0200, Jean-Marc Lasgouttes wrote:
> Le 12/10/2015 11:16, Stephan Witt a écrit :
> >Am 12.10.2015 um 11:04 schrieb Jean-Marc Lasgouttes <lasgout...@lyx.org>:
> >
> >>Le 10/10/2015 21:31, Stephan Witt a écrit :
> >>>Another question with "dead store" code is in RowPainter::paintFirst:
> >>>
> >>>The y_top assignments are not used.
> >>>JMarc, do you know if the code block simply can be removed?
> >>
> >>The code was already like that in 2.1.
> >
> >Yes, it dates back to at least 2007. Earlier I couldn't "git blame" anymore.
> 
> I found the same. Who has a good tutorial about git archeology?

How about the following?

  git log -Sy_top

man git log:

       -S<string>
           Look for differences that change the number of occurrences of the 
specified string (i.e. addition/deletion) in a file. Intended for
           the scripter’s use.

           It is useful when you’re looking for an exact block of code (like a 
struct), and want to know the history of that block since it first
           came into being: use the feature iteratively to feed the interesting 
block in the preimage back into -S, and keep going until you get
           the very first version of the block.

Note that it takes a few minutes to run. The oldest commit it shows is:
27de1486ca34aaad446adb798d71a77d6f6304da

Since y_top could be a common name to call various variables, it's good to 
check that it is the same y_top that is in question here. Doing

  git show 27de1486ca34aaad446adb798d71a77d6f6304da

suggests that it is indeed the y_top discussed here.

Another way to approach it is to search for the commit that introduced the 
comment. That will probably show a useful commit because if the comment was 
introduced the commit is probably about that actual code, and not about 
renaming or white space changes, etc.

Scott

Reply via email to