commit - d21e4af15cb6b519e3dfcb3b542be7d68939fcf9
commit + ee44f00ccbdcf7ef792a7e364fe1d1986b343c8f
blob - 5372625814924a4a0c2f9556c4ae58bbe4dda8f6
blob + 8025d2c6cf309a35ac68860e60e1f642156d8dae
--- README.md
+++ README.md
- File status in the Commit tool window (`got status`)
- Native diff and modified-lines gutter (`got cat` against the base commit)
- Commit and rollback from the Commit tool window (`got commit`, `got revert`)
+- A **Commit and Send** button next to the default Commit action: commits
+ and opens the native Push dialog in one step
+- A **Log tab** with the full commit graph, refs (branches/remote
+ branches/tags), and per-commit changed files
- File history (`got log`) and Update Project (`got update` / `got fetch`)
-- Current branch name shown in the main toolbar, and the native Push dialog
- (`Ctrl+Shift+K`) for `got send`
+- Current branch name shown in the status bar, and the native Push dialog
+ (`Ctrl+Shift+K`) with real outgoing-commit detection for `got send`
+- Automatic refresh of the Commit panel and Log tab after commit, push, or
+ update — including changes made outside the IDE (e.g. `got commit` in a
+ terminal)
- A Settings panel (*Settings > Version Control > got*) to override the
`got` binary path and `SSH_AUTH_SOCK`, for setups where auto-detection
doesn't apply
the `got` binary for the relevant work tree and adapts its output to the
corresponding IntelliJ Platform VCS API.
-| IntelliJ feature | got command |
-|--------------------|-------------------------------------------|
-| VCS root detection | presence of a `.got/` directory |
-| File status | `got status` |
-| Diff / gutter | `got cat -c :base` |
-| Commit | `got commit -m <message> <paths>` |
-| Rollback | `got revert -R <paths>` |
-| History | `got log` |
-| Update Project | `got fetch` + `got update` |
-| Branch widget | `got info` ("work tree branch reference") |
-| Push | `got send` |
+| IntelliJ feature | got command |
+|---------------------|-------------------------------------------------|
+| VCS root detection | presence of a `.got/` directory |
+| File status | `got status` |
+| Diff / gutter | `got cat -c :base` |
+| Commit | `got commit -m <message> <paths>` |
+| Rollback | `got revert -R <paths>` |
+| Commit and Send | `got commit`, then opens the Push dialog |
+| Log tab | `got log -b`, `got cat`, `got ref -l` |
+| History | `got log` |
+| Update Project | `got fetch` + `got update` |
+| Branch widget | `got info` ("work tree branch reference") |
+| Push | `got send` |
+| Outgoing commits | `got ref -l` + `got log -x` against the remote |
Source is organized by responsibility under `dev.nezzontli.gotvcs`:
- `changes`, `checkin`, `history`, `update`, `roots` — one package per VCS
extension point implemented
- `repo` — the `Repository` model and the branch-name status bar widget
-- `push` — native Push dialog support (`PushSupport` and friends)
+- `push` — native Push dialog support (`PushSupport` and friends), including
+ outgoing-commit detection
+- `log` — the Log tab (`VcsLogProvider`) and the refresh notifier that keeps
+ it and the Commit panel up to date
- `settings` — the persisted configuration and its Settings panel
## Requirements
blob - e6a518896eee269fea77590094f5e58301ff67cb
blob + 1d7241fe7fad6239e70175758ee0e846b632fd5f
--- build.gradle.kts
+++ build.gradle.kts
}
group = "dev.nezzontli"
-version = "0.1.0"
+version = "0.2.0"
repositories {
mavenCentral()
}
changeNotes = """
- File status, native diff, commit/rollback, history, update/fetch,
- a branch-name widget, the native Push dialog, and a Settings
- panel for the got binary path and SSH_AUTH_SOCK.
+ <ul>
+ <li>A Log tab (commit graph, refs, per-commit changed files)</li>
+ <li>Real outgoing-commit detection in the native Push dialog</li>
+ <li>A "Commit and Send" button that commits and opens Push</li>
+ <li>got recognized as a distributed VCS, enabling the
+ non-modal Commit tool window</li>
+ <li>Automatic refresh of the Commit panel and Log tab after
+ commit/push/update, and after external got changes (e.g. from
+ a terminal)</li>
+ </ul>
""".trimIndent()
}
blob - b70c56e49fba205519e06536cdfe496117543d97
blob + a174e1330779a484aacc5a77a49e7dbdb3a86c72
--- src/main/kotlin/dev/nezzontli/gotvcs/GotVcs.kt
+++ src/main/kotlin/dev/nezzontli/gotvcs/GotVcs.kt
override fun getDisplayName(): String = NAME
// got is a distributed VCS (local commits, explicit `got send`), same
- // shape as Git. The platform only enables its non-modal Commit tool
+ // shape as Git. The platform only enables the non-modal Commit tool
// window when every active VCS reports VcsType.distributed here --
- // AbstractVcs.getType() defaults to centralized, which silently forces
- // the old modal commit dialog and greys out the Commit tool window
- // entirely (verified via CommitModeManager.canSetNonModal() bytecode).
+ // the default (centralized) forces the old modal commit dialog instead.
override fun getType(): VcsType = VcsType.distributed
override fun getChangeProvider(): ChangeProvider = changeProvider
blob - 1bafc5551fbf24be1e68f4fbbe5554e781501dcb
blob + 346e876546512bf483379ebbf8089e4ef06235b1
--- src/main/kotlin/dev/nezzontli/gotvcs/checkin/GotCheckinEnvironment.kt
+++ src/main/kotlin/dev/nezzontli/gotvcs/checkin/GotCheckinEnvironment.kt
return exceptions
}
- /**
- * GotCommitAndSendExecutor's session is CommitSession.VCS_COMMIT itself
- * (see that class) so this same, already-correct commit() path runs --
- * unversioned/deleted files included -- exactly as for the plain
- * "Commit" button; PUSH_AFTER_COMMIT_KEY just tells us to also open the
- * Push dialog afterwards. Opening it is a UI action and must happen on
- * the EDT, unlike commit() itself which may run on a background thread.
- */
+ // Opening the Push dialog is a UI action and must happen on the EDT,
+ // unlike commit() itself which may run on a background thread.
private fun openPushDialogAfterCommit(changes: List<Change>) {
val vcsManager = ProjectLevelVcsManager.getInstance(project)
val repositoryManager = project.getService(GotRepositoryManager::class.java)
return exceptions
}
- /** Marks the affected roots dirty and pings the Log tab's refresher, if one is registered, so neither needs a manual reload after a commit. */
private fun notifyRootsChanged(filePaths: List<FilePath>) {
val vcsManager = ProjectLevelVcsManager.getInstance(project)
val notifier = project.getService(GotVcsRefreshNotifier::class.java)
blob - 5c092520c9796da978ad16911533733ced67cccc
blob + 13183989ffb44260fa87902443637dca53692e2e
--- src/main/kotlin/dev/nezzontli/gotvcs/checkin/GotCommitAndSendExecutor.kt
+++ src/main/kotlin/dev/nezzontli/gotvcs/checkin/GotCommitAndSendExecutor.kt
const val COMMIT_AND_SEND_EXECUTOR_ID = "Got.Commit.And.Send"
/**
- * Mirrors Git's own "Commit and Push": rather than reimplementing the
- * commit, this just flags the CommitContext and returns CommitSession
- * .VCS_COMMIT, the sentinel meaning "run the normal commit" -- so the
- * platform's own automatic handling of unversioned/deleted files (which a
- * fully custom CommitSession does not get; verified by decompiling
- * ChangesViewCommitWorkflowHandler and CommitSessionInfo.isVcsCommit())
- * still applies. GotCheckinEnvironment checks PUSH_AFTER_COMMIT_KEY once
- * the commit succeeds and opens the native Push dialog from there.
+ * Flags the CommitContext and returns CommitSession.VCS_COMMIT (the "run
+ * the normal commit" sentinel) rather than reimplementing commit, so the
+ * platform's own handling of unversioned/deleted files still applies.
+ * GotCheckinEnvironment checks PUSH_AFTER_COMMIT_KEY once the commit
+ * succeeds and opens the native Push dialog from there.
*/
class GotCommitAndSendExecutor : CommitExecutor {
blob - 421cc67980c2ee122d14bf5e4d19ec764e5d36d1
blob + dad1ad78090237cde7d0a663c00b340a6eae611c
--- src/main/kotlin/dev/nezzontli/gotvcs/log/GotVcsLogProvider.kt
+++ src/main/kotlin/dev/nezzontli/gotvcs/log/GotVcsLogProvider.kt
*/
class GotVcsLogProvider(private val project: Project) : VcsLogProvider {
- // A default-valued second constructor parameter here (as this used to
- // have, before needing `project` for the refresh notifier) makes Kotlin
- // emit a single constructor with a synthetic $default bridge, which the
- // platform's reflective EP instantiation doesn't recognize as "a
- // (Project) constructor" -- it silently failed to construct this class
- // at all, which is why the whole Log tab disappeared. Every other
- // extension point in this plugin avoids this by taking only `project`
- // and constructing its own GotCommandLineWrapper as a plain field.
private val commandLine = GotCommandLineWrapper()
override val supportedVcs: VcsKey = GotVcs.getKey()
override val referenceManager: VcsLogRefManager = GotVcsLogRefManager()
// getCurrentBranch()/getCurrentUser() are called from EDT-bound UI code
- // (CurrentBranchHighlighter.update(), on every visible-pack refresh -- and
- // likely an equivalent "my commits" highlighter for getCurrentUser), so
- // neither can shell out to `got` synchronously -- same class of bug fixed
- // earlier for GotRepository/GotBranchWidget. readAllHashes() always runs
- // off the EDT (it's the Log tab's own background data loading), and
- // always runs before those highlighters can fire, so precomputing both
- // here and serving them from cache is safe.
+ // on every visible-pack refresh, so they can't shell out to `got`
+ // synchronously. readAllHashes() always runs off the EDT and before
+ // those callers can fire, so precomputing both here is safe.
private val currentBranchCache = ConcurrentHashMap<String, String>()
private val currentUserCache = ConcurrentHashMap<String, VcsUser>()
blob - 18c8428fd3d94eb15e1dbe893875d7fb53bfeb27
blob + a6dd0a63121ba168cd3275d6a5e99e4a6de1f598
--- src/main/resources/META-INF/plugin.xml
+++ src/main/resources/META-INF/plugin.xml
<ul>
<li>Detects .got/ work trees automatically</li>
<li>File status, native diff, and modified-lines gutter</li>
- <li>Commit and rollback from the Commit tool window</li>
+ <li>Commit and rollback from the Commit tool window, plus a
+ Commit and Send button</li>
+ <li>A Log tab with the commit graph, refs, and per-commit
+ changed files</li>
<li>File history and Update Project (got update / got fetch)</li>
- <li>Branch name widget and native Push dialog (Ctrl+Shift+K)</li>
+ <li>Branch name widget and native Push dialog (Ctrl+Shift+K)
+ with real outgoing-commit detection</li>
+ <li>Automatic refresh of the Commit panel and Log tab, including
+ for changes made outside the IDE</li>
<li>Settings panel for the got binary path and SSH_AUTH_SOCK</li>
</ul>
See the <a href="https://github.com/Richard7987/gotvcs-intellij">README</a> for details on how each feature maps to the underlying got command.