Skip to content

Commit

Permalink
Initial implementation of blame
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jul 1, 2024
1 parent 8ed976a commit d862754
Show file tree
Hide file tree
Showing 5 changed files with 671 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/main/java/org/codetracker/AttributeTrackerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import org.codetracker.api.CodeElementNotFoundException;
import org.codetracker.api.History;
import org.codetracker.api.Version;
import org.codetracker.api.History.HistoryInfo;
import org.codetracker.change.Change;
import org.codetracker.change.ChangeFactory;
import org.codetracker.change.attribute.AttributeCrossFileChange;
import org.codetracker.change.Change.Type;
import org.codetracker.element.Attribute;
import org.eclipse.jgit.api.Git;
Expand Down Expand Up @@ -237,4 +240,17 @@ else if (leftInitializer != null && rightInitializer == null) {
return new HistoryImpl<>(changeHistory.get().getCompleteGraph(), historyReport);
}
}

private History.HistoryInfo<Attribute> blameReturn() {
List<HistoryInfo<Attribute>> history = HistoryImpl.processHistory(changeHistory.get().getCompleteGraph());
Collections.reverse(history);
for (History.HistoryInfo<Attribute> historyInfo : history) {
for (Change change : historyInfo.getChangeList()) {
if (!(change instanceof AttributeCrossFileChange)) {
return historyInfo;
}
}
}
return null;
}
}
Loading

0 comments on commit d862754

Please sign in to comment.