Skip to content

git checkout: suggest commits for the first argument - #424

Open
pardeep-singh wants to merge 1 commit into
warpdotdev:mainfrom
pardeep-singh:pardeep-singh/git-checkout-commits
Open

pardeep-singh wants to merge 1 commit into
warpdotdev:mainfrom
pardeep-singh:pardeep-singh/git-checkout-commits

Conversation

@pardeep-singh

Copy link
Copy Markdown

Adds the existing commits generator to git checkout's first positional argument. git checkout <TAB> now suggests commits (for detached-HEAD checkouts) alongside branches, remote branches and tags.

reset, show, revert, cherry-pick, diff and log already use commits. I appended it after the ref generators, matching the order git log uses.

Addresses warpdotdev/warp#691. Once this merges, I'll open the warp PR that bumps the warp-command-signatures rev.

Changes

  • json/git.json: the generatorName for checkout's first argument now ends with "commits".
  • src/generators/git.rs: new test test_checkout_first_argument_completes_commits. It asserts that checkout's first argument still uses the branch and tag generators and now also uses commits.

Testing

  • The new test failed before the JSON change ("...should use the commits generator, got ["local_branches", "remote_branches", "refs_remote_branches", "tags"]") and passes after it.
  • cargo test, cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings and npm run format:check all pass.

Possible follow-ups (not in this PR)

  • git switch arg 0, used by git switch --detach <commit>, doesn't suggest commits.
  • git restore --source <tree> has no generator.

Add the existing commits generator to checkout's first positional
argument, alongside branches and tags, as reset, show and cherry-pick
already do. Addresses warpdotdev/warp#691.

Signed-off-by: Pardeep Singh <pardeep.shergill17@gmail.com>
@cla-bot

cla-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @pardeep-singh on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@warp-factories

Copy link
Copy Markdown
Contributor

@pardeep-singh, your GitHub account is not connected to Warp. Connect your GitHub account.

@pardeep-singh

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Oct 16, 2026
@cla-bot

cla-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant