gage blame
The gage blame command finds the sessions that wrote the lines of a file. For
each line it reports the session, the tool call that wrote the line, and the
lines of the session to read. For a walk-through, see
See context for a code change.
--lines takes a line (42), a range (10-20), or a comma-separated list of
them (10-20,42). Lines are numbered from 1 and a range includes both ends.
--native, --stored, and --stored-remote select the sessions to read, and
each excludes the other two. With none of them, the command reads the default
session source. They have the meaning they have for
gage session.
How a line is attributed
The command follows git blame. The commit of each line bounds a window of
time. The earliest tool call in that window whose input carries the text of the
line is the call that wrote it. A line that no tool call carries is not
attributed.
Output
Each line of the file is one row.
The session lines run from the human prompt before the tool call through the
call itself. gage session view takes the first
column as its argument and opens the session at those lines. A - marks a
line that is not attributed.
JSON output
--json writes one object for each range of lines attributed to one tool
call. It includes every candidate call for a line, where the text output shows
only the first.
match is one of patch, input, command, or neighbor, from the
strongest evidence to the weakest.
The same rows are available in SQL through the blame table function. See
gage query.