next-issue 6.6.38 → 6.6.39

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.md CHANGED
@@ -39,6 +39,8 @@ writes the summary of the issues it handled and exits with code 1.
39
39
 
40
40
  Only one run goes at a time in a repository. A run holds `.next-issue/run.lock`, with its process id and the start time of that process, from its start to its end, and the worker takes the same lock for each run it starts. A run that starts while another run, from the worker or from the command line, is going claims no issue and fails at once with an error that names the other run and its process id (a command-line run exits with code 1, and a run started from the worker ends with status `failed` and the error text): `the worker (process id <n>) has a run going in this repository` or `another next-issue run (process id <n>) is going in this repository`. A lock whose process is gone, or started at another time, is stale and taken over, as with the worker lock.
41
41
 
42
+ Every command uses the main worktree of the repository as its root, the first one that `git worktree list` shows, even when it runs in a linked worktree. So `.next-issue/`, with the config, the locks, the worker socket, the saved state and the notes, and `.worktrees/` are always in the main worktree, and a run or worker started from a linked worktree gets the same refusal as one started from the main worktree.
43
+
42
44
  A run handles up to `concurrency` issues at the same time, 1 by default. When an
43
45
  issue ends, the run fetches the open issues again and claims the oldest unseen
44
46
  one for the free slot. Each issue has its own worktree and branch. Step 3 below
@@ -369,7 +371,7 @@ To write the file with the defaults, run the `init` command in the repository:
369
371
  npx -y next-issue@latest init
370
372
  ```
371
373
 
372
- The command writes `.next-issue/config.json` in the repository and adds
374
+ The command writes `.next-issue/config.json` in the main worktree and adds
373
375
  `.next-issue/` and `.worktrees/` to `info/exclude` in the git directory, which
374
376
  linked worktrees share. It removes those two lines from `.gitignore`, and
375
377
  deletes `.gitignore` when nothing else is left in it. It moves a
package/dist/git.mjs CHANGED
@@ -16,7 +16,10 @@ export function parseRemote(url) {
16
16
  throw new Error(`Cannot parse the git remote URL: ${url}`);
17
17
  }
18
18
  export async function repoRoot(cwd) {
19
- return git(cwd, ['rev-parse', '--show-toplevel']);
19
+ const top = await git(cwd, ['rev-parse', '--show-toplevel']);
20
+ const list = await git(cwd, ['worktree', 'list', '--porcelain']);
21
+ const [first = '', second = ''] = list.split('\n');
22
+ return first.startsWith('worktree ') && second !== 'bare' ? first.slice('worktree '.length) : top;
20
23
  }
21
24
  export async function detectRepo(cwd, remote) {
22
25
  const root = await repoRoot(cwd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.38",
3
+ "version": "6.6.39",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",