carson 3.13.0 → 3.13.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d653b3c6ec67aa729186db46215c6e51c85a42ac82ca782f5004f9d84e32a31
4
- data.tar.gz: 5caa70de1a5c9538c3ef3027ba0862445c9ff2d985ec6f4659231bb40d8e5cb7
3
+ metadata.gz: bb773d053eb0271bf5b1997349eaf9afa972ad5ba8612a3930764e2ace68592d
4
+ data.tar.gz: 957745cc1c1f0ee91e2a58062e6730b4ff09f3c78e7c7178f7d7d602ac74b858
5
5
  SHA512:
6
- metadata.gz: 91bd6ee521d91f31c3593558e1b544fcba99eefd1d084fb8c618fad428c470d308ed774e7655b31be9d0fc35969bd9d5354832d5002042396e3d48b8ffde77b2
7
- data.tar.gz: 10758df9aeb5d246211592671eb19c59156cbd9fd7cb5d6e31e32186ee36d1caef8fe3dc7c785bdbfbac4e1339ee8d56bf445556a6722395f8eb42a2bfdabe12
6
+ metadata.gz: f547c3aa8645e9da8877c24e645dad85896cd3640890f9da2c6d35cd5557fe0fcd784e3dd75a74910d677544be2294aace0720bd6267e56f1fb7e99c3abe094b
7
+ data.tar.gz: 01a7ec9498cae31c12e1f68a3498381ad8f7bb5a229de5b2e833c410b06cca4759abd426583b39c766b931d1e829c3fae1cb9272d12b60ea52e59328296bb287
data/RELEASE.md CHANGED
@@ -5,6 +5,12 @@ Release-note scope rule:
5
5
  - `RELEASE.md` records only version deltas, breaking changes, and migration actions.
6
6
  - Operational usage guides live in `MANUAL.md` and `API.md`.
7
7
 
8
+ ## 3.13.1
9
+
10
+ ### What changed
11
+
12
+ - **Content-aware unpushed-commits guard** — `carson worktree remove` no longer falsely blocks after squash or rebase merges. Previously it compared commit SHAs, which differ after squash merge even though the content is on main. Now it compares tree content via `git diff --quiet`: if the branch's content matches main, the work is already merged and removal proceeds without `--force`.
13
+
8
14
  ## 3.13.0
9
15
 
10
16
  ### What changed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.13.0
1
+ 3.13.1
@@ -220,6 +220,7 @@ module Carson
220
220
  end
221
221
 
222
222
  # Checks whether a branch has unpushed commits that would be lost on removal.
223
+ # Content-aware: after squash/rebase merge, SHAs differ but tree content may match main. Compares content, not SHAs.
223
224
  # Returns nil if safe, or { error:, recovery: } hash if unpushed work exists.
224
225
  def check_unpushed_commits( branch:, worktree_path: )
225
226
  return nil unless branch
@@ -231,8 +232,16 @@ module Carson
231
232
  # Remote ref does not exist. Only block if the branch has unique commits vs main.
232
233
  unique, _, unique_status, = Open3.capture3( "git", "rev-list", "--count", "#{config.main_branch}..#{branch}", chdir: worktree_path )
233
234
  if unique_status.success? && unique.strip.to_i > 0
234
- return { error: "branch has not been pushed to #{remote}",
235
- recovery: "git -C #{worktree_path} push -u #{remote} #{branch}, or use --force to override" }
235
+ # Content-aware check: after squash/rebase merge, commit SHAs differ
236
+ # but the tree content may be identical to main. Compare content,
237
+ # not SHAs — if the diff is empty, the work is already on main.
238
+ diff_out, _, diff_ok, = Open3.capture3( "git", "diff", "--quiet", config.main_branch, branch, chdir: worktree_path )
239
+ unless diff_ok.success?
240
+ return { error: "branch has not been pushed to #{remote}",
241
+ recovery: "git -C #{worktree_path} push -u #{remote} #{branch}, or use --force to override" }
242
+ end
243
+ # Diff is empty — content is on main (squash/rebase merged). Safe.
244
+ puts_verbose "branch #{branch} content matches main — squash/rebase merged, safe to remove"
236
245
  end
237
246
  elsif ahead.strip.to_i > 0
238
247
  return { error: "worktree has unpushed commits",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carson
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 3.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hailei Wang