Exercise

How can I see who changed what in a file?

git log displays the overall history of a project or file, but Git can give even more information. The command git annotate file shows who made the last change to each line of a file and when. For example, the first three lines of output from git annotate report.txt look something like this:

04307054        (  Rep Loop     2017-09-20 13:42:26 +0000       1)# Seasonal Dental Surgeries (2017) 2017-18
5e6f92b6        (  Rep Loop     2017-09-20 13:42:26 +0000       2)
5e6f92b6        (  Rep Loop     2017-09-20 13:42:26 +0000       3)TODO: write executive summary.

Each line contains five elements, with elements two to four enclosed in parentheses. When inspecting the first line, we see:

  1. The first eight digits of the hash, 04307054.
  2. The author, Rep Loop.
  3. The time of the commit, 2017-09-20 13:42:26 +0000.
  4. The line number, 1.
  5. The contents of the line, # Seasonal Dental Surgeries (2017) 2017-18.

You are in the dental repository. Use a single command to see the changes to report.txt. How many different sets of changes have been made to this file (i.e., how many distinct hashes show up in the first column of the output)?

Instructions

50 XP

Possible answers