Skip to content

WIP: Compare Two Non-Consecutive Commits

This is a WIP for comparing any two commits with each other, currently in gitg we only compare a commit with the commit directly before it, allowing the user to only select one commit at a time and displaying the result in the diff-view at the bottom of the program.

In this WIP, I'm implementing the feature requested in #270, where the user will be able to compare any two commits(in the same or different branches)

There are multiple ideas for design proposed at the issue itself, we maybe would need to try some of them out and see what works the best

Here is a list of things to be finished for that feature to be complete:

  • selection of two commits using ctrl+click
    • refactor HistoryView for multiple selection
    • extend CommitListView for multiple selection support
  • Modify the DiffView Class and the Diff Plugin to support comparing two commits
    • extend Gitg.Commit class to get diff with another commit object passed to it
    • create a new class that manages inserting/clearing commit from the DiffView
    • refactor DiffView and Diff to use the newly created class
  • figure out a way to be able to select different commits between different branches maybe using contextual menu as @albfan suggested on the issue
  • figure out what would be the best way to indicate that two commits are currently being compared
Edited by Mahmoud Khalil

Merge request reports