Skip to content

Add an Allow Empty Commits option to the Cherry Pick dialog - #936

Open
senwong wants to merge 1 commit into
mhutchie:developfrom
senwong:feat/cherry-pick-allow-empty
Open

senwong wants to merge 1 commit into
mhutchie:developfrom
senwong:feat/cherry-pick-allow-empty

Conversation

@senwong

@senwong senwong commented Sep 10, 2026

Copy link
Copy Markdown

Summary of the issue:

Cherry picking an initially empty commit, or a commit whose changes are already present, stops with an error. The Cherry Pick dialog currently provides no way to keep that commit without switching to the terminal.

Description outlining how this pull request resolves the issue:

Adds an Allow Empty Commits checkbox and the git-graph.dialog.cherryPick.allowEmpty setting (default: false). When selected, both initially empty and redundant commits are preserved using --keep-redundant-commits, which works with older supported Git versions as well as current ones. The option has no effect when No Commit is selected; the dialog explains this behavior.

Adds regression coverage for configuration defaults, request forwarding, command arguments, merge parents, and the interaction with No Commit. Documents the new setting in the README.

Validation:

  • Lint and backend compilation passed.
  • Frontend type checking passed with tsc -p ./web --types node, followed by successful production JS/CSS packaging.
  • Full test suite: 1,270 passed, 3 failed. The same three avatar URL parsing tests fail on the unchanged upstream commit in this environment.
  • Checked eight dialog logic scenarios covering normal/merge commits, both default values, and both checkbox selections.
  • Real Git 2.39.3 smoke checks passed for initially empty commits, redundant commits, unchanged default behavior, and No Commit staging without creating a commit.

Environment note: the normal frontend build encounters TypeScript 4.0 parser errors in the currently resolved @types/babel__traverse. Using --types node avoids unrelated ambient test types without changing repository configuration or dependencies. The VS Code Extension Development Host was not exercised.

@senwong
senwong requested a review from mhutchie as a code owner September 10, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant