@getsolaris/copse 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  Git worktree를 쉽게 관리하세요. 설정 기반 자동화, 모노레포 지원, 헬스 체크로 worktree를 생성, 전환, 정리할 수 있습니다.
12
12
 
13
+ ### 왜 "copse"인가요?
14
+
15
+ **Copse**는 나무 몇 그루가 옹기종기 모여 자라는 작은 숲을 뜻합니다. Git worktree는 브랜치를 별도의 작업 디렉토리로 체크아웃한 것 — 각각이 하나의 *나무(tree)*입니다. 하나의 레포에서 여러 worktree를 관리한다면, 그건 작은 숲을 가꾸는 것과 같습니다. 그게 바로 copse입니다.
16
+
13
17
  ## 주요 기능
14
18
 
15
19
  - **TUI 모드** — 인터랙티브 터미널 UI (`copse`)
@@ -278,6 +282,8 @@ copse init --skill claude-code
278
282
  ```bash
279
283
  copse add feature/login # 필요하면 브랜치를 만들고 worktree 생성
280
284
  copse add feature/login --base main # 새 브랜치는 main에서 시작
285
+ copse add feature/login --base origin/main # origin/main 을 자동 fetch 후 분기 (아래 참고)
286
+ copse add feature/login --base origin/main --no-fetch # 자동 fetch 건너뛰기
281
287
  copse add existing-branch # 기존 브랜치로 worktree 생성
282
288
 
283
289
  # 모노레포: 포커스 패키지와 함께 생성
@@ -292,6 +298,33 @@ copse add --pr 123
292
298
  copse add --pr 456 --template review
293
299
  ```
294
300
 
301
+ #### Remote 인식 base + 자동 fetch
302
+
303
+ `--base` (또는 config 의 `defaults.base`) 값이 `<remote>/<branch>` 패턴이고 `<remote>` 가 실제로 등록된
304
+ git remote 이면, `copse add` 는 worktree 를 만들기 전에 `git fetch <remote> <branch>` 를 먼저 실행합니다.
305
+ stale 한 remote-tracking ref 에서 실수로 분기하는 걸 막아줍니다.
306
+
307
+ - `--base main`, `--base develop`, `--base HEAD`, `--base <sha>` → fetch 없음 (local ref).
308
+ - `--base origin/main`, `--base upstream/release/v2` → 해당 브랜치만 fetch 후 분기.
309
+ - `--base fork/main` 인데 `fork` 가 등록된 remote 가 아님 → local ref 로 취급 (fetch 없음).
310
+ - Fetch 실패 (오프라인, 인증 오류 등) 시 경고만 출력하고 local copy 로 계속 진행합니다.
311
+ - 대상 브랜치가 이미 로컬에 존재하면 자동 fetch 는 건너뜁니다 (`--base` 는 새 브랜치에만 의미).
312
+
313
+ `--no-fetch` 로 자동 fetch 를 강제로 건너뛸 수 있습니다. 매번 `copse add` 에서 remote-aware base 를
314
+ 기본으로 하고 싶으면 `defaults.base` 를 설정하세요:
315
+
316
+ ```json
317
+ {
318
+ "version": 1,
319
+ "defaults": {
320
+ "base": "origin/main"
321
+ }
322
+ }
323
+ ```
324
+
325
+ Base 우선순위 (높은 쪽이 이김): `--base` 플래그 → `template.base` → repo 별 `repos[].base` →
326
+ `defaults.base` → git `HEAD`.
327
+
295
328
  ### `copse doctor`
296
329
 
297
330
  ```bash
@@ -652,6 +685,7 @@ copse: created default config at /Users/you/.config/copse/config.json
652
685
  | `linkFiles` | `string[]` | `[]` | 심볼릭 링크할 파일/디렉토리 (디스크 절약) |
653
686
  | `postCreate` | `string[]` | `[]` | worktree 생성 후 실행할 커맨드 |
654
687
  | `postRemove` | `string[]` | `[]` | worktree 제거 전 실행할 커맨드 |
688
+ | `base` | `string` | — | 새 브랜치의 기본 base ref. 값이 등록된 remote 의 `<remote>/<branch>` 형태이면 `copse add` 가 `git fetch <remote> <branch>` 를 자동 실행 |
655
689
 
656
690
  #### `repos[]`
657
691
 
@@ -665,6 +699,7 @@ copse: created default config at /Users/you/.config/copse/config.json
665
699
  | `linkFiles` | `string[]` | 아니오 | 기본 링크 파일 오버라이드 |
666
700
  | `postCreate` | `string[]` | 아니오 | 기본 postCreate 훅 오버라이드 |
667
701
  | `postRemove` | `string[]` | 아니오 | 기본 postRemove 훅 오버라이드 |
702
+ | `base` | `string` | 아니오 | 기본 base ref 오버라이드 |
668
703
  | `monorepo` | `object` | 아니오 | 모노레포 지원 설정 |
669
704
 
670
705
  #### `workspaces[]`
package/README.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  Manage git worktrees with ease. Create, switch, and clean up worktrees with config-driven automation, monorepo support, and built-in health checks.
12
12
 
13
+ ### Why "copse"?
14
+
15
+ A **copse** is a small group of trees growing closely together. Git worktrees are branches checked out as separate working directories — each one a *tree*. When you manage multiple worktrees for a single repo, you're tending a little grove. That's a copse.
16
+
13
17
  ## Features
14
18
 
15
19
  - **TUI mode** — interactive terminal UI (`copse`)
@@ -295,6 +299,8 @@ Every commit runs `validateConfig` before writing. Invalid input surfaces as an
295
299
  ```bash
296
300
  copse add feature/login # Create branch if needed + worktree
297
301
  copse add feature/login --base main # New branches start from main
302
+ copse add feature/login --base origin/main # Auto-fetches origin/main first (see below)
303
+ copse add feature/login --base origin/main --no-fetch # Skip auto-fetch
298
304
  copse add existing-branch # Worktree for existing branch
299
305
 
300
306
  # Monorepo: create with focus packages
@@ -309,6 +315,33 @@ copse add --pr 123
309
315
  copse add --pr 456 --template review
310
316
  ```
311
317
 
318
+ #### Remote-aware base + auto-fetch
319
+
320
+ When `--base` (or `defaults.base` in config) matches `<remote>/<branch>` and `<remote>` is a
321
+ known git remote, `copse add` runs `git fetch <remote> <branch>` before creating the worktree.
322
+ This prevents accidentally branching from a stale local copy of a remote-tracking ref.
323
+
324
+ - `--base main`, `--base develop`, `--base HEAD`, `--base <sha>` → no fetch (local ref).
325
+ - `--base origin/main`, `--base upstream/release/v2` → fetch that specific branch, then branch from it.
326
+ - `--base fork/main` when `fork` is not a configured remote → treated as a local ref (no fetch).
327
+ - Fetch failures (offline, auth errors) print a warning and continue with the local copy.
328
+ - Auto-fetch is skipped when the target branch already exists locally (`--base` only matters for new branches).
329
+
330
+ Pass `--no-fetch` to skip the auto-fetch unconditionally. Set `defaults.base` to make
331
+ remote-aware base the default for every `copse add`:
332
+
333
+ ```json
334
+ {
335
+ "version": 1,
336
+ "defaults": {
337
+ "base": "origin/main"
338
+ }
339
+ }
340
+ ```
341
+
342
+ Base resolution order (highest wins): `--base` flag → `template.base` → per-repo
343
+ `repos[].base` → `defaults.base` → git `HEAD`.
344
+
312
345
  ### `copse doctor`
313
346
 
314
347
  ```bash
@@ -669,6 +702,7 @@ All repos inherit these unless overridden.
669
702
  | `linkFiles` | `string[]` | `[]` | Files/dirs to symlink (saves disk) |
670
703
  | `postCreate` | `string[]` | `[]` | Commands to run after worktree creation |
671
704
  | `postRemove` | `string[]` | `[]` | Commands to run before worktree removal |
705
+ | `base` | `string` | — | Default base ref for new branches. If it matches `<remote>/<branch>` of a known remote, `copse add` auto-runs `git fetch <remote> <branch>` first |
672
706
 
673
707
  #### `repos[]`
674
708
 
@@ -682,6 +716,7 @@ Per-repo overrides. Each entry requires `path`.
682
716
  | `linkFiles` | `string[]` | No | Override default link files |
683
717
  | `postCreate` | `string[]` | No | Override default post-create hooks |
684
718
  | `postRemove` | `string[]` | No | Override default post-remove hooks |
719
+ | `base` | `string` | No | Override default base ref |
685
720
  | `monorepo` | `object` | No | Monorepo support config |
686
721
 
687
722
  #### `workspaces[]`