Skip to content

Commit 364197c

Browse files
Merge pull request #125 from triblespace/codex/update-commit-selector-to-use-set-operations
Improve two-dot commit range semantics
2 parents 0b2bf7b + 0f15040 commit 364197c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
149149
- Introduced an `ancestors` selector to retrieve a commit and its history.
150150
- Commit selectors now return a `CommitSet` patch of commit handles instead of a `Vec`.
151151
- Renamed the `CommitPatch` type alias to `CommitSet`.
152+
- The `..` commit selector now computes `reachable(end) minus reachable(start)`
153+
via set operations, matching Git's two-dot semantics even across merges.
152154

153155
## [0.5.2] - 2025-06-30
154156
### Added

src/repo.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,9 @@ where
938938
CommitSet,
939939
WorkspaceCheckoutError<<Blobs::Reader as BlobStoreGet<Blake3>>::GetError<UnarchiveError>>,
940940
> {
941-
let mut patch = collect_range(ws, Some(self.start), Some(self.end), true)?;
942-
// Exclude the starting commit to mirror git semantics
943-
patch.remove(&self.start.raw);
944-
Ok(patch)
941+
let patch = collect_reachable(ws, self.end)?;
942+
let exclude = collect_reachable(ws, self.start)?;
943+
Ok(patch.difference(&exclude))
945944
}
946945
}
947946

0 commit comments

Comments
 (0)