Commit ebd67243 by Ben Straub

Only show lines that had blame run on them

parent d2e7532f
...@@ -128,22 +128,24 @@ int main(int argc, char *argv[]) ...@@ -128,22 +128,24 @@ int main(int argc, char *argv[])
while (i < git_blob_rawsize(blob)) { while (i < git_blob_rawsize(blob)) {
const char *eol = strchr(rawdata+i, '\n'); const char *eol = strchr(rawdata+i, '\n');
char oid[10] = {0}; char oid[10] = {0};
const git_blame_hunk *hunk = git_blame_get_hunk_byline(blame, line);
git_commit *hunkcommit; git_commit *hunkcommit;
const git_signature *sig; const git_signature *sig;
const git_blame_hunk *hunk = git_blame_get_hunk_byline(blame, line);
git_oid_tostr(oid, 10, &hunk->final_commit_id); if (hunk) {
check(git_commit_lookup(&hunkcommit, repo, &hunk->final_commit_id), "Commit lookup error"); git_oid_tostr(oid, 10, &hunk->final_commit_id);
sig = git_commit_author(hunkcommit); check(git_commit_lookup(&hunkcommit, repo, &hunk->final_commit_id), "Commit lookup error");
sig = git_commit_author(hunkcommit);
printf("%s ( %-30s %3d) %.*s\n",
oid, printf("%s ( %-30s %3d) %.*s\n",
sig->name, oid,
line, sig->name,
(int)(eol-rawdata-i), line,
rawdata+i); (int)(eol-rawdata-i),
rawdata+i);
git_commit_free(hunkcommit);
}
git_commit_free(hunkcommit);
i = eol - rawdata + 1; i = eol - rawdata + 1;
line++; line++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment