Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## [2025.3.2]

### Fixes

- Fixed [Diff popup selection missing](https://github.com/comod/git-scope-pro/issues/76)
- Fixed [HEAD diff logic does not handle root directories outside git repo](https://github.com/comod/git-scope-pro/issues/75)
- Fixed several refresh&stability issues

### Added

- Added [filnames in project explorer and tabs colored based on GitScope](https://github.com/comod/git-scope-pro/issues/74)

## [2025.3.1]

### Fixes
Expand Down
163 changes: 163 additions & 0 deletions CLASSES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Plugin Classes to Check in HPROF Analysis

This document lists all plugin classes to search for when analyzing heap dumps to identify memory leaks after plugin
unload. All classes should have **count = 0** after successful plugin unload.

## Services

*Expected: 1 instance per project, or 0 after unload*

- `service.ViewService`
- `service.ToolWindowService`
- `service.ToolWindowServiceInterface` *(interface - unlikely to leak but check if implemented by plugin classes)*
- `service.StatusBarService`
- `service.GitService`
- `service.TargetBranchService`
- `implementation.compare.ChangesService`

## State/Persistence

- `state.State`
- `state.MyModelConverter`
- `state.WindowPositionTracker`

## Listeners

*Expected: 0 after unload*

- `listener.MyBulkFileListener`
- `listener.MyDynamicPluginListener`
- `listener.MyToolWindowListener`
- `listener.VcsStartup`
- `listener.MyChangeListListener`
- `listener.MyGitRepositoryChangeListener`
- `listener.MyFileEditorManagerListener`
- `listener.MyTabContentListener`
- `listener.MyTreeSelectionListener`
- `listener.ToggleHeadAction`
- `listener.VcsContextMenuAction`

## UI Components

### Main Components

- `toolwindow.ToolWindowView`
- `toolwindow.ToolWindowUIFactory`
- `toolwindow.BranchSelectView`
- `toolwindow.TabOperations`
- `toolwindow.VcsTreeActions`

#### Actions
- `toolwindow.actions.TabMoveActions`
- `toolwindow.actions.TabMoveActions$MoveTabLeft`
- `toolwindow.actions.TabMoveActions$MoveTabRight`
- `toolwindow.actions.RenameTabAction`
- `toolwindow.actions.ResetTabNameAction`

### UI Elements

- `toolwindow.elements.VcsTree`
- `toolwindow.elements.BranchTree`
- `toolwindow.elements.BranchTreeEntry`
- `toolwindow.elements.MySimpleChangesBrowser`
- `toolwindow.elements.CurrentBranch`
- `toolwindow.elements.TargetBranch`

## Status Bar

- `statusBar.MyStatusBarWidget`
- `statusBar.MyStatusBarWidgetFactory`
- `statusBar.MyStatusBarPanel`

## Models

- `model.MyModel`
- `model.MyModel$field` *(enum - check for RxJava subscription leaks)*
- `model.MyModelBase`
- `model.TargetBranchMap`
- `model.Debounce`

## Implementation Classes

### Line Status Tracker

- `implementation.lineStatusTracker.MyLineStatusTrackerImpl`
- `implementation.lineStatusTracker.CommitDiffWorkaround`

### Scope

- `implementation.scope.MyScope`
- `implementation.scope.MyPackageSet` *(registered with NamedScopeManager - critical leak if not unregistered)*
- `implementation.scope.MyScopeInTarget`
- `implementation.scope.MyScopeNameSupplier`

### File Status

- `implementation.fileStatus.GitScopeFileStatusProvider`

## Utility Classes

- `utils.CustomRollback`
- `utils.GitCommitReflection`
- `utils.GitUtil`
- `utils.Notification`
- `system.Defs`

## Anonymous/Inner Classes to Look For

*These are patterns - search for classes matching these names:*

- `TabOperations$1` *(rename action)*
- `TabOperations$2` *(reset action)*
- `TabOperations$3` *(move left action)*
- `TabOperations$4` *(move right action)*
- `VcsTree$$Lambda` *(any lambda from VcsTree)*
- `MyLineStatusTrackerImpl$1` *(BaseRevisionSwitcher anonymous inner class - circular reference)*
- `MyLineStatusTrackerImpl$$Lambda` *(lambdas from line status tracker)*
- `MySimpleChangesBrowser$1` *(anonymous MouseAdapter)*
- `BranchTree$MyColoredTreeCellRenderer`
- Any class ending with `$$Lambda$...`

---

## How to Search Efficiently

### 1. Search by Package Prefix

Filter the HPROF classes view using these prefixes:

- `service.`
- `listener.`
- `toolwindow.`
- `implementation.`
- `model.`
- `state.`
- `statusBar.`
- `utils.`

### 2. Filter the Classes View

1. Sort by "Count" column
2. Look for `count != 0`
3. Focus on YOUR packages (ignore `com.intellij.*`, `java.*`, `kotlin.*`)

### 3. Priority Classes to Check

*Most likely to leak:*

1. **All listeners** - Must be unregistered
2. **TabOperations and its anonymous classes** - Actions must be unregistered
3. **ToolWindowView** - UI components must be disposed
4. **ViewService** - RxJava subscriptions must be disposed
5. **MyLineStatusTrackerImpl** - Background tasks must be cancelled
6. **Any class with `$` in the name** - Anonymous/inner classes often capture outer references

---

## Analysis Steps

1. Open the `.hprof` file in IntelliJ's memory profiler
2. Navigate to the "Classes" view
3. Sort by "Count" column in descending order
4. Search for each class using the package prefixes above
5. **Report back any classes with `count != 0`** and we'll fix them!
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@

### Story

I think every developer loves to check their changes with **version control** before committing.
But there is a big problem with the current IntelliJ-based IDEs after committing the code: All changes in **version
control** and also the line status disappear completely. Usually a branch contains more than one commit. This plugin
helps you to make these commits visible again in an intuitive way!

To make changes visible you can create custom "scopes" for any target branch, tag or any valid git reference. Each of
the defined scopes will be selectable as a tab in the **GIT SCOPE** tool window. The current selected "scope" is
displayed as a:

- Overall project tree diff in the **GIT SCOPE** tool window
- Editor "line status" in the "line gutter" for each opened file (if file gutter is enabled)
- Custom "scope" that can be used for example when searching and finally as a
- Status bar widget
Developers rely on version control to review changes before committing. However, IntelliJ-based IDEs have a significant
limitation: after committing code, all change indicators in version control and line status annotations disappear
completely. Since feature branches typically contain multiple commits, this makes it difficult to track accumulated
changes over time. This plugin addresses that problem by making committed changes visible again.

Create custom "scopes" for any Git reference—branch, tag, or commit hash. Each defined scope appears as a selectable tab
in the **GIT SCOPE** tool window. The currently selected scope visualizes changes through:

- **Scope tree diff** — Shows all modified files in the GIT SCOPE tool window
- **File colors** - Files highlighted in editor tabs and project window according to the GIT SCOPE status (added;
modified; deleted; ...)
- **Editor line status** — Displays change markers in the editor gutter for open files
- **Custom scope** — Enables filtered search, replace, and inspection operations
- **Status bar widget** — Displays the current scope selection

### Plugin Basics

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
pluginGroup=org.woelkit.plugins
pluginName=Git Scope
pluginRepositoryUrl=https://github.com/comod/git-scope-pro
pluginVersion=2025.3.1
pluginVersion=2025.3.2
pluginSinceBuild=243

platformType=IU
#platformVersion=LATEST-EAP-SNAPSHOT
platformVersion=2025.3
platformVersion=2025.3.1

platformBundledPlugins=Git4Idea
gradleVersion=9.2.1
Expand Down
Loading