carson 4.3.5 → 4.4.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.
- checksums.yaml +4 -4
- data/RELEASE.md +11 -0
- data/VERSION +1 -1
- data/lib/carson/warehouse/workbench.rb +2 -5
- data/lib/carson/worktree.rb +5 -14
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b22cfd5f4976a5367d0a815fac4f360049673aaa585a3783c7296f155be896a9
|
|
4
|
+
data.tar.gz: bdc3f70b4b74dcb489b8dde16ca0244846b4082fc6697713ce83490cb64319c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a77aa24657d4863d5de2a06e14b14e0f339cd9b9ac709933f2b2ec084de721a101781867a7b3a4bb0557623968247ca4333cf5821660778ce0ddd70c20f780ba
|
|
7
|
+
data.tar.gz: 5113678e26302f1eb7b9a5c93e59f4a357434ddade3ec9b4eec00f412c1af8b77888b132ab5f849594e04621d0af57e8e9969f3e0292b23b18bb215894a1dac9
|
data/RELEASE.md
CHANGED
|
@@ -7,6 +7,17 @@ Release-note scope rule:
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## 4.4.0
|
|
11
|
+
|
|
12
|
+
### New
|
|
13
|
+
|
|
14
|
+
- **Auto-chdir on checkout from inside worktree.** `carson checkout` no longer blocks when the current working directory is inside the worktree being removed. Carson `Dir.chdir`s to the main worktree root and completes the removal automatically. Both the warehouse (`assess_removal`) and legacy (`remove_check`) paths are fixed.
|
|
15
|
+
- **Parent shell excluded from held-by-other-process check.** `held_by_other_process?` now excludes `Process.ppid` (the user's shell that launched Carson) in addition to `Process.pid`. Prevents false blocks when the user runs `carson checkout` from inside the worktree.
|
|
16
|
+
|
|
17
|
+
### Why
|
|
18
|
+
|
|
19
|
+
Running `carson checkout` from inside the target worktree is the most natural invocation — agents and users are already there. Blocking and printing a recovery command added friction for no safety benefit, since Carson can move its own process out.
|
|
20
|
+
|
|
10
21
|
## 4.3.5
|
|
11
22
|
|
|
12
23
|
### Fixed
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.4.0
|
|
@@ -232,11 +232,8 @@ module Carson
|
|
|
232
232
|
return { status: :ok, missing: true }
|
|
233
233
|
end
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
error: "current working directory is inside this worktree",
|
|
238
|
-
recovery: "cd #{main_worktree_root} && carson checkout #{File.basename( workbench.path )}" }
|
|
239
|
-
end
|
|
235
|
+
# Auto-chdir out so removal can proceed.
|
|
236
|
+
Dir.chdir( main_worktree_root ) if workbench.holds_cwd?
|
|
240
237
|
|
|
241
238
|
if workbench.held_by_other_process?
|
|
242
239
|
return { status: :block, result_status: "block",
|
data/lib/carson/worktree.rb
CHANGED
|
@@ -270,18 +270,8 @@ module Carson
|
|
|
270
270
|
entry = find( path: resolved_path, runtime: runtime )
|
|
271
271
|
branch = entry&.branch
|
|
272
272
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
return {
|
|
276
|
-
status: :block,
|
|
277
|
-
result_status: "block",
|
|
278
|
-
exit_code: Runtime::EXIT_BLOCK,
|
|
279
|
-
resolved_path: resolved_path,
|
|
280
|
-
branch: branch,
|
|
281
|
-
error: "current working directory is inside this worktree",
|
|
282
|
-
recovery: "cd #{safe_root} && carson checkout #{File.basename( resolved_path )}"
|
|
283
|
-
}
|
|
284
|
-
end
|
|
273
|
+
# Auto-chdir out so removal can proceed.
|
|
274
|
+
Dir.chdir( runtime.main_worktree_root ) if entry&.holds_cwd?
|
|
285
275
|
|
|
286
276
|
if entry&.held_by_other_process?
|
|
287
277
|
return {
|
|
@@ -388,11 +378,12 @@ module Carson
|
|
|
388
378
|
return false if stdout.nil? || stdout.empty?
|
|
389
379
|
|
|
390
380
|
normalised = File.join( canonical, "" )
|
|
391
|
-
|
|
381
|
+
# Exclude this process and its parent (the user's shell that launched Carson).
|
|
382
|
+
excluded_pids = [ Process.pid, Process.ppid ].to_set
|
|
392
383
|
stdout.lines.drop( 1 ).any? do |line|
|
|
393
384
|
fields = line.strip.split( /\s+/ )
|
|
394
385
|
next false unless fields.length >= 9
|
|
395
|
-
next false if fields[ 1 ].to_i
|
|
386
|
+
next false if excluded_pids.include?( fields[ 1 ].to_i )
|
|
396
387
|
name = fields[ 8.. ].join( " " )
|
|
397
388
|
name == canonical || name.start_with?( normalised )
|
|
398
389
|
end
|