Skip to content

refactor: unify git-daft and daft command routing#123

Merged
avihut merged 1 commit intomasterfrom
daft-122/git-daft
Jan 31, 2026
Merged

refactor: unify git-daft and daft command routing#123
avihut merged 1 commit intomasterfrom
daft-122/git-daft

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Jan 31, 2026

Summary

  • Merges the separate git-daft and daft dispatch arms in main.rs into a single "git-daft" | "daft" match arm, so adding new subcommands only requires updating one place
  • Updates get_clap_args() in lib.rs to handle "git-daft" as a program name, enabling git daft worktree-checkout and similar worktree subcommands
  • Removes the now-unnecessary GIT_DAFT_SUBCOMMANDS constant and its associated tests from suggest.rs
  • Extends the --version flag to work for both daft --version and git daft --version

Fixes #122

Test plan

  • cargo fmt -- --check passes
  • cargo clippy -- -D warnings passes with zero warnings
  • just test-unit passes (133 tests, 0 failures)
  • Manual smoke test: git daft hooks status, git daft --version, git daft completions --help, git daft unknown-cmd (should suggest)
  • Integration tests via CI

🤖 Generated with Claude Code

Make `git daft <subcommand>` fully equivalent to `daft <subcommand>` by
merging the two separate dispatch arms into one. This eliminates the need
to add new commands in two places.

- Combine "git-daft" and "daft" match arms in main.rs using or-pattern
- Extend --version check to also handle git-daft invocation
- Update get_clap_args() to handle "git-daft" program name for worktree subcommands
- Remove GIT_DAFT_SUBCOMMANDS constant and associated tests from suggest.rs
- Derive error label from resolved name for correct "git daft" vs "daft" messaging

Fixes #122

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@avihut avihut merged commit acd0d58 into master Jan 31, 2026
5 checks passed
@avihut avihut deleted the daft-122/git-daft branch January 31, 2026 11:35
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.

git daft should be equivalent to regular daft

1 participant