feat: add stageOnMove setting for visual-only change lists - #7
Open
ChaoticLuna wants to merge 1 commit into
Open
ChaoticLuna wants to merge 1 commit into
ChaoticLuna wants to merge 1 commit into
Conversation
Moving files between change lists implicitly staged/unstaged them in Git, coupling list membership to the index and making accidental commits easy. Add a gitChangeLists.stageOnMove setting (default true, preserving current behavior). When disabled, change lists are purely organizational (JetBrains semantics) and never touch the index; untracked files respect their explicit list mapping, and staging is done explicitly via the 'Stage Change List' command. Co-authored-by: Kimi K3 <noreply@moonshot.ai>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
ChaoticLuna
marked this pull request as ready for review
July 27, 2026 06:59
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, moving a file into a change list implicitly runs
git add(and moving it to the Unversioned list unstages it). This couples change list membership to the Git index: a purely organizational action silently changes what the next commit will contain, which makes accidental commits easy.In JetBrains IDEs, changelists are a purely organizational concept — grouping files never touches the staging area. This PR makes that behavior available here as an opt-in setting, enabling a visual-only grouping mode.
Changes
package.json: register a newgitChangeLists.stageOnMoveboolean setting (defaulttrue), with a description explaining thatfalsemakes grouping purely visual and that the "Stage Change List" command should be used to stage explicitly.src/utils/constants.ts: addCONFIG.STAGE_ON_MOVEkey.src/services/configService.ts: addgetStageOnMove(), following the existinggetCommitGuardEnabled()pattern. It reads the live configuration on every call, so changing the setting takes effect immediately without a reload.src/services/changeListManager.ts:moveFiles: whenstageOnMoveisfalse, skip bothstageFiles(moving into a regular list) andunstageFiles(moving to the Unversioned list); only the internalfileMappingis updated.getFilesForList: whenstageOnMoveisfalse, untracked files respect their explicit list mapping instead of always appearing in the Unversioned list (files are no longer implicitly staged, so untracked files can now legitimately belong to a regular list); unmapped untracked files still appear in Unversioned.ConfigServiceis injected via the constructor.src/extension.ts: pass the existingconfigServiceinstance toChangeListManager.Behavior
stageOnMove: true): no behavior change — moving files stages/unstages them exactly as before.stageOnMove: false: change lists are purely visual groups; moving files between them never modifies the Git staging area. The "Stage Change List" and "Commit Change List" commands are unaffected and continue to stage/commit explicitly.Testing
npm run compile(tsc) passes cleanly.npm run lintcould not be run:eslintis not installed in the project's devDependencies.