Skip to content

Commit 096ca2e

Browse files
committed
remove a TODO that turned out to be unnecessary.
After all, stopping the merge when there is any conflict is highly relevant.
1 parent 3fb989b commit 096ca2e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ What follows is a high-level list of features and those which are planned:
4646
* [x] blob-diff
4747
* [ ] merge
4848
- [x] blobs
49-
- [ ] trees
49+
- [x] trees
5050
- [ ] commits
5151
* [ ] rebase
5252
* [ ] commit

gix-merge/src/tree/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,8 @@ pub struct Options {
236236
/// The context to use when invoking merge-drivers.
237237
pub blob_merge_command_ctx: gix_command::Context,
238238
/// If `Some(what-is-unresolved)`, the first unresolved conflict will cause the entire merge to stop.
239-
/// This is useful to see if there is any conflict, without performing the whole operation.
240-
// TODO: Maybe remove this if the cost of figuring out conflicts is so low - after all, the data structures
241-
// and initial diff is the expensive thing right now, which are always done upfront.
242-
// However, this could change once we know do everything during the traversal, which probably doesn't work
243-
// without caching stuff and is too complicated to actually do.
239+
/// This is useful to see if there is any conflict, without performing the whole operation, something
240+
/// that can be very relevant during merges that would cause a lot of blob-diffs.
244241
pub fail_on_conflict: Option<UnresolvedConflict>,
245242
/// This value also affects the size of merge-conflict markers, to allow differentiating
246243
/// merge conflicts on each level, for any value greater than 0, with values `N` causing `N*2`

gix/src/repository/merge.rs

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ impl Repository {
111111
/// `labels` are typically chosen to identify the refs or names for `our_tree` and `their_tree` and `ancestor_tree` respectively.
112112
///
113113
/// `options` should be initialized with [`tree_merge_options()`](Self::tree_merge_options()).
114+
///
115+
/// ### Performance
116+
///
117+
/// It's highly recommended to [set an object cache](crate::Repository::compute_object_cache_size_for_tree_diffs)
118+
/// to avoid extracting the same object multiple times.
114119
// TODO: Use `crate::merge::Options` here and add niceties such as setting the resolution strategy.
115120
pub fn merge_trees(
116121
&self,

0 commit comments

Comments
 (0)