Skip to content

Shorten apply examples by omitting --from auto#11

Merged
satococoa merged 1 commit intomainfrom
codex/omit-from-auto-in-docs
Mar 17, 2026
Merged

Shorten apply examples by omitting --from auto#11
satococoa merged 1 commit intomainfrom
codex/omit-from-auto-in-docs

Conversation

@satococoa
Copy link
Copy Markdown
Owner

@satococoa satococoa commented Mar 17, 2026

Summary

  • shorten README apply examples to rely on the default source selection
  • update the generated post-checkout hook snippet to omit the redundant --from auto
  • align hook-related tests with the simplified command examples

Testing

  • env GOCACHE=/tmp/git-worktreeinclude-gocache go test ./internal/hooks -run TestPrintSnippetPostCheckout
  • internal/cli tests were not rerun successfully in this environment because .worktreeinclude is globally ignored here and some runs also hit network/cache restrictions

Summary by CodeRabbit

  • Documentation
    • Simplified apply command syntax by removing the --from auto flag from examples and guidance.
    • Clarified default behavior in documentation.
    • Updated auto-apply hook snippet to reflect simplified command format.

Copilot AI review requested due to automatic review settings March 17, 2026 15:07
@satococoa satococoa merged commit 9d353b3 into main Mar 17, 2026
5 checks passed
@satococoa satococoa deleted the codex/omit-from-auto-in-docs branch March 17, 2026 15:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee14bf70-af78-4cf8-b6e3-a0bccac5532a

📥 Commits

Reviewing files that changed from the base of the PR and between 4198130 and 710db60.

📒 Files selected for processing (5)
  • README.md
  • internal/cli/cli_integration_test.go
  • internal/cli/cli_unit_test.go
  • internal/hooks/hooks.go
  • internal/hooks/hooks_test.go

📝 Walkthrough

Walkthrough

This pull request removes the explicit --from auto flag from the git-worktreeinclude apply command across documentation, hook generation code, and tests, reflecting that this is now the default behavior.

Changes

Cohort / File(s) Summary
Documentation
README.md
Removed --from auto flag from command examples and updated semantics description to clarify default behavior without explicit flag requirement.
Hook generation
internal/hooks/hooks.go, internal/hooks/hooks_test.go
Changed post-checkout hook snippet generation to omit --from auto flag; updated test expectations to match new generated output.
CLI tests
internal/cli/cli_integration_test.go, internal/cli/cli_unit_test.go
Updated test assertions to expect hook print output without the --from auto flag in the command line.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 The --from auto flag takes flight,
No longer needed—defaults shine bright!
Simpler commands, cleaner calls,
The hook hops forward through the halls. 🌟

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/omit-from-auto-in-docs
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies user-facing apply examples and the generated post-checkout hook snippet by omitting the redundant --from auto flag, relying on the CLI default behavior.

Changes:

  • Update README apply examples and hook snippet to remove --from auto.
  • Update the post-checkout hook snippet returned by hooks.PrintSnippet.
  • Align hook-related unit/integration tests to match the new snippet text.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/hooks/hooks.go Removes --from auto from the generated post-checkout hook snippet.
internal/hooks/hooks_test.go Updates snippet assertion to match the simplified hook output.
internal/cli/cli_unit_test.go Updates hook print unit test expectation for the new snippet text.
internal/cli/cli_integration_test.go Updates integration test expectation for the printed hook snippet.
README.md Shortens apply/hook examples to rely on the default source selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## `.worktreeinclude` semantics

- Place `.worktreeinclude` at the source worktree root (for `--from auto`, this is typically the main worktree).
- Place `.worktreeinclude` at the source worktree root (by default, this is typically the main worktree selected by `--from auto`).
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.

2 participants