WIP: Creates A New Compare Activity That Handles Comparing Between Two Different Branches/Commits
gitg doesn't yet support comparison functionality, this [my GSoC Project] helps to integrate this new functionality in
This MR creates a new
Compare Activity in
gitg in which users will be able to select different branches either to see the difference of commits between them, or to list the different commits of the two branches where users will be able to select any two commits to compare.
Inside the Compare Activity, three views are implemented:-
MainView, in which the users will be able to select different branches
BranchView, in which will be shown the difference of commits between the two selected branches in a
CommitsView, in which will be shown the two branches' commits, where users will be able to select two commits to compare, each from different branch.
Here's what has been implemented on the backend side:-
libgitgwith a new
Popoverto list the available branches, following the @felipeborges implementation of
IdentifyingOSPopover. You could see his awesome implementation here
GitgCommitModelso that we can provide a
RevisionWalkerfor it, instead of creating a new one itself
GitgDiffViewto update the diff on Idle to make the application more responsive
GitgRefActionComparewhich if selected, will set the selected branch as one of the branches to be compared automatically, then make a transition to the
Here's what has been implemented on the frontend side:-
decide what's the best way to implement it, whether to share the same
RevisionWalker, or to create two models for the two branches with different
MainViewwhere user can choose which branches to compare
use the previously mentioned
BranchesPopoverto list the available branches to the user
- detect if it's a bare repository, and show a message to the user to indicate that instead of displaying empty lists
- use the previously mentioned
BranchView, where comparison between branches is shown, e.g. Gitlab, and Github.
- implement the model to only show the difference of the commits between the "Source Branch" and the "Target Branch"
CommitsView, where comparison between two different commits from different/same branch is shown
- detect whether the two branches are the same, and use the same model if they were
load branches models serially to make use of the
CompareActivity whenever there is a change in the repository, or new commits added