β οΈ VERY IMPORTANT: This is an educational project. (Severe) bugs can be expected, and may not be fixed quickly. Please use with caution.
A More Interactive Rebase for JetBrains is a plugin for the integrated development environments (IDEs) from JetBrains. The tool makes it easier for you to perform Git Interactive Rebase actions, without the need for a command line, by providing a clear graphical visualization of the commit history and the changes you want to perform on it.
- β¨ Features
- β Installation
- β‘ Quick Start
- π Dependencies
- π€ Contributing
- β Support
- πΊ Roadmap
- β Authors and Acknowledgement
A More Interactive Rebase offers the following functionality for a better user experience:
- Opens in the editor tab for a better visualization
- Shows clearly the commit history in the form of a graph
- Gives details about the commits and their file changes
- Allows performing interactive rebase actions on selected commits
- Allows reordering of commits by drag-and-drop
- Displays two branches with their relation visually
- Allows changing the base of a branch on top of another branch
- Shows the difference between the changed graph and the initial state
- Allows for cherry-picking a commit
- Shows the progress of the rebase and the commit on which it has stopped due to conflicts
You can easily get started with setting up the plugin by following these guidelines:
- Download the Plugin zip on your device
- Extract the files in it in a folder
- Open a JetBrains IDE and navigate to Settings/Preferences > Plugins > βοΈ > Install plugin from disk...
- Navigate to the folder of the Plugin and select
interactive-rebase-jetbrains-version.jar
- The Plugin should be in the list of Plugins and you can search for it by name A More Interactive Rebase
- Click on the Plugin and enable it
- Restart your IDE
Navigate to Tools > Interactive Rebase Current Branch. The Plugin opens as a file in the editor tab. The branch drawn shows the latest commits on the checked out branch. Closing the Plugin and opening it again keeps the changes that were made.
Clicking on one or multiple commits selects them. The commit information and file changes of the selected commits are presented on the right side of the screen. Double-clicking on a file change opens its diff and shows the changes.
After selecting the commits, the buttons that are active show the available Interactive Rebase actions. It is
important to note that any changes made on the graph are not actually executed until the Start Rebasing
button
is pressed. The idea of the graph is to show a preview of how the commit history will look in the end. All actions
can be taken in various ways including the action toolbar, a context menu opened on a right click and keyboard shortcuts
If you are not very familiar with the Interactive Rebase actions that Git has to offer, you can read the
Rewriting History Chapter provided by Git for more information.
- Drop - After selecting commits, pressing the
Drop
button will remove the selected commits from the commit history. The action can also be performed by selecting one or multiple commits and pressingBackspace
/Delete
or by opening the context menu and selecting the action.
- Fixup - If there is only one selected commit, pressing the
Fixup
button will perform fixup of that commit with the previous one (older in the commit history). In the case where multiple commits are selected, they are fixed up into the oldest selected commit. This action combines automatically the commit messages of the selected commits. The action can also be performed by selecting one or multiple commits and pressingOption
/Alt
+F
or by opening the context menu and selecting the action.
- Pick - Selecting the commits and pressing
Pick
reverts all changes done on them except for reordering. The action can also be performed by selecting one or multiple commits and pressingOption
/Alt
+P
or by opening the context menu and selecting the action.
- Reorder - You can drag and drop the commits along the branch if you want to reorder them. The action can
also be performed by selecting one or multiple commits and pressing
Option
/Alt
+β‘
to move the commit upward orOption
/Alt
+β£
to move the commit downward.
- Reword - If a single commit is selected you can click the
Reword
button that opens a text field in place of the commit message. Alternatively, if there is no selected commit, you can just double-click on a commit message, which will also enable the text field. The action can also be performed by selecting one commit and pressingOption
/Alt
+R
or by opening the context menu and selecting the action.You can edit the message and pressEnter
or click anywhere outside of the text field. If you want to cancel your rewording, pressingEscape
closes the text field.
- Squash - If there is only one selected commit pressing the
Squash
button will squash that commit with the previous one (older in the commit history). In the case where multiple commits are selected, they get squashed into the oldest selected commit. After squashing, a text field opens for you to reword the commit message for the squashed commit. The action can also be performed by selecting one or multiple commits and pressingOption
/Alt
+S
or by opening the context menu and selecting the action.
- Stop to Edit - After selecting commits and pressing the
Stop to Edit
button the IDE opens each commit in chronological order (from oldest to newest) and allows you to make changes to that commit (amend it). After having made your changes, you have to stage them by typinggit add .
. PressingContinue
on the pop-up in the lower right corner of the screen will proceed with the rebasing of the next commit. You can also pressAbort
to stop the stop-to-edit action. While rebasing is happening, it is possible to visualize which commits have already been rebased and on which commit we are stopping to edit, this can be seen by the progress on our tool that colors commits that have already been rebased. The action can also be performed by selecting one or multiple commits and pressingOption
/Alt
+E
or by opening the context menu and selecting the action.
- Add Branch - Pressing the
Add Branch
button opens the branch selection panel. This panel contains all the names of all local branches of the repository. The action can also be performed by selecting pressingOption
/Alt
+A
. A branch can be selected by pressing it or by navigating to it making use of theβ‘
andβ£
arrow keys and pressingEnter
, once a branch is selected, it will also be displayed in the main panel of the plugin. To deselect it press the-
button or pressEscape
when in focus.
- See Difference - Pressing the
See Difference
button opens a popup that displays the original state of the branch and the state of the branch with all the actions taken. It provides a better understanding of the actions to perform. The action can also be performed by selecting pressingCmd
/Ctrl
+D
.
- Undo - Pressing the
Undo
button will revert the last action taken on the tool regardless of the commit it was taken on. The action can also be performed by selecting pressingCmd
/Ctrl
+Z
. - Redo - Pressing the
Undo
button will reapply the most recently undone action on the tool. The action can
also be performed by selecting pressingCmd
/Ctrl
+Shift
+Z
.
- Collapsing - Pressing the
Collapse
will automatically hide commits such that the whole branch can fit on the screen without scrolling if no commits are selected. In the case that commits are selected, only these commits will become hidden. To expand the hidden commit, simply press on the three dots representing the collapsed commits. The action can also be performed by pressingCmd
/Ctrl
+C
.
- Rebasing - After selecting a commit in the added branch, pressing the
Rebase Onto
button will rebase the checked out branch on top of the selected commit of the added branch. If no commit is selected, the checked out branch will rebase on the head of the added branch. The action can also be performed by dragging the label containing the name of the checked out branch pressing over the label of the added branch. It can also be accessed by pressingAlt
/Option
+Shift
+R
or by opening the context menu.
- Cherry Pick - After selecting a commit in the added branch and pressing the
Cherry Pick
button, the selected commit will be added as the new head of the checked out branch. It is also possible to drag and drop a commit from the added branch to any position of the checked out branch. The action can also be performed by pressingOption
/Alt
+C
- Reset - Pressing the
Reset
button reverts the graph to its initial state, before any changes were indicated. The action can also be performed by pressingCmd
/Ctrl
+R
.
-
Start Interactive Rebase - Pressing the
Rebase
button starts the Interactive Rebase and executes all the changes that were made starting from the lowest changed commit on the graph. The action can also be performed by pressingOption
/Alt
+Enter
. -
Keyboard Navigation - Using the arrow keys allows for keyboard navigation. When no commit is selected,
β‘
will select the bottommost commit andβ£
will select the topmost commit. Holding downShift
while pressing the arrow keys will make it so that multiple commits are selected. Pressingβ
will give focus to the branch selection panel if the checked out branch is selected. In the case that the added branch is selected, it will select the checked out branch. Pressingβ’
will in turn select the checked out branch if the branch selection panel is focused and it will select the added branch if the checked out branch is selected. PressingEscape
will deselect all selected commits.
-
Selecting a commit - Use arrow keys
β
andβ
to move up and down on a branch. Pressβ
andβ
to move between branches. UseShift
for range selection. -
Selecting multiple commits - Press
Shift
+Click
for range selection andCommand
/Ctrl
+Click
for non-contiguous selection. -
Deselecting commits -
Escape
-
Select branch -
Enter
(Branch Selection Panel) -
Deselect branch -
Escape
(Branch Selection Panel) -
Drop -
Backspace
/Delete
-
Fixup -
Option
/Alt
+F
-
Pick -
Option
/Alt
+P
-
Reorder -
Option
/Alt
+β
/β
-
Reword -
Option
/Alt
+R
-
Squash -
Option
/Alt
+S
-
Stop to Edit -
Option
/Alt
+E
-
Add branch -
Option
/Alt
+A
-
See Difference -
Cmd
/Ctrl
+D
-
Undo -
Cmd
/Ctrl
+Z
-
Redo -
Cmd
/Ctrl
+Shift
+Z
-
Collapse -
Cmd
/Ctrl
+C
-
Rebase Onto -
Option
/Alt
+Shift
+R
-
Cherry Pick -
Option
/Alt
+C
-
Reset -
Ctrl
+R
-
Start Interactive Rebase -
Option
/Alt
+Enter
In order for our Plugin to interact with the current JetBrains IDEs we are making use of the Intellij Platform API. This streamlines the process of building a Plugin by offering extension points to already existing functionality. It is the framework on which JetBrains' IDEs are based and provides a Virtual File System as a Component. The UI of this product is built using the UI framework of IntelliJ Platform, specifically custom classes that extend the Swing functionality. Thus, incorporating the signature design of the IDE. Furthermore, IntelliJ Platform provides additional run configurations within the Gradle project which provide a number of actions such as: simulating an IDE with our plugin for manual testing, creating a JAR file from which the plugin can be executed and immediately publishing into JetBrains Marketplace, etc.
To allow interaction with Git functionality, we use the git4idea Plugin as a library. It provides methods for calling Git commands such as Git Rebase, Git Log, Git reset, etc. In order to establish the connection the folder git4ideaClasses in this project contains some of the git4Idea classes with the respective copy right.
Our Plugin is compatible with IntelliJ Community 2024.1 and newer versions.
For managing the dependencies during runtime and testing we use Gradle 8.7. It is included and recommended in the already available documentation provided on IntelliJ Plugin Platform SDK. We have defined tasks for tools such as Jacoco and Spotless.
The plugin was developed in Kotlin, used with Java SDK 17 to ensure backwards compatibility.
The UI of the plugin was developed with Swing.
The product is unit tested with the frameworks JUnit 4 and Mockito, and the library AssertJ. All test classes are extending the BasePlatformTestCase class of the IntelliJ test Framework. This provided access to test fixtures like a test project, which was essential for instantiating all units responsible for executing the business logic.
For system/integration testing the plugin uses VCS Platform Test in order to set up all the git actions. To effectively
generate Git resources, we made use of two utility classes: GitExecutor
and GitTestUtil
.
We relied on the Awaitility library. We used it to pause test execution until specific slow operations fulfill a certain assertion.
If you want to contribute to our project please refer to the Contributing Guide.
For any questions and difficulties, please refer to our Support guide.
Since the project is still under development, here you can see the plan for the foreseeable future. You can see the whole Roadmap via this link. Keep in mind that opening it requires access to the repository.
![roadmap.png](Images/Roadmap 27.04.2024.png)
Main contributors to the project are the members of our team:
- Marina MΔdΔraΕ
- Diego Becerra Merodio
- Aleksandra Savova
- Ada Turgut
- Galya Vergieva