diff --git a/README.md b/README.md index 2bbc1ab..996c0c5 100644 --- a/README.md +++ b/README.md @@ -24,18 +24,18 @@ Subcommands are explicit. Use `git-worktreeinclude apply ...`. ### Apply ```sh -git-worktreeinclude apply --from auto +git-worktreeinclude apply ``` Or via Git extension: ```sh -git worktreeinclude apply --from auto +git worktreeinclude apply ``` ## `.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`). - Format is gitignore-compatible (`#` comments, blank lines, `!` negation, `/` anchors, `**`, etc.). - `.worktreeinclude` may be tracked, untracked, or ignored; if the file exists in the source worktree, it is used. - Actual sync target is the intersection of: @@ -159,7 +159,7 @@ Run this immediately after creating a worktree: ```sh git worktree add -b -git -C worktreeinclude apply --from auto --json +git -C worktreeinclude apply --json ``` - Evaluate success by exit code @@ -186,7 +186,7 @@ set -eu old="$1" if [ "$old" = "0000000000000000000000000000000000000000" ]; then - git worktreeinclude apply --from auto --quiet || true + git worktreeinclude apply --quiet || true fi ``` @@ -201,7 +201,7 @@ fi Notes: - `git worktree add --no-checkout` may not trigger `post-checkout`. -- In that case, run `git worktreeinclude apply --from auto` manually. +- In that case, run `git worktreeinclude apply` manually. ## Exit codes diff --git a/internal/cli/cli_integration_test.go b/internal/cli/cli_integration_test.go index 444ccab..12c8c41 100644 --- a/internal/cli/cli_integration_test.go +++ b/internal/cli/cli_integration_test.go @@ -350,7 +350,7 @@ func TestHookPathAndPrint(t *testing.T) { if code != 0 { t.Fatalf("hook print exit code = %d", code) } - if !strings.Contains(snippet, "git worktreeinclude apply --from auto --quiet || true") { + if !strings.Contains(snippet, "git worktreeinclude apply --quiet || true") { t.Fatalf("unexpected hook snippet: %s", snippet) } } diff --git a/internal/cli/cli_unit_test.go b/internal/cli/cli_unit_test.go index 585b940..a156e32 100644 --- a/internal/cli/cli_unit_test.go +++ b/internal/cli/cli_unit_test.go @@ -105,7 +105,7 @@ func TestRunHookPrint(t *testing.T) { if code != exitcode.OK { t.Fatalf("Run returned %d, want %d; stderr=%s", code, exitcode.OK, stderr.String()) } - if !strings.Contains(stdout.String(), "git worktreeinclude apply --from auto --quiet || true") { + if !strings.Contains(stdout.String(), "git worktreeinclude apply --quiet || true") { t.Fatalf("unexpected snippet: %q", stdout.String()) } } diff --git a/internal/hooks/hooks.go b/internal/hooks/hooks.go index a914284..6711bfb 100644 --- a/internal/hooks/hooks.go +++ b/internal/hooks/hooks.go @@ -10,7 +10,7 @@ set -eu old="$1" if [ "$old" = "0000000000000000000000000000000000000000" ]; then - git worktreeinclude apply --from auto --quiet || true + git worktreeinclude apply --quiet || true fi `, nil default: diff --git a/internal/hooks/hooks_test.go b/internal/hooks/hooks_test.go index 0b4a98c..54b3562 100644 --- a/internal/hooks/hooks_test.go +++ b/internal/hooks/hooks_test.go @@ -10,7 +10,7 @@ func TestPrintSnippetPostCheckout(t *testing.T) { if err != nil { t.Fatalf("PrintSnippet returned error: %v", err) } - if !strings.Contains(got, "git worktreeinclude apply --from auto --quiet || true") { + if !strings.Contains(got, "git worktreeinclude apply --quiet || true") { t.Fatalf("unexpected snippet: %q", got) } }