@@ -86,14 +86,14 @@ impl Index {
86
86
)
87
87
}
88
88
89
- /// Return all `Change`s that are observed between the last time `peek_changes*(…)` was called
89
+ /// Return all [ `Change`] s that are observed between the last time `peek_changes*(…)` was called
90
90
/// and the latest state of the `crates.io` index repository, which is obtained by fetching
91
91
/// the remote called `origin` or whatever is configured for the current `HEAD` branch and lastly
92
92
/// what it should be based on knowledge about he crates index.
93
- /// The ` last_seen_reference()` will not be created or updated.
93
+ /// The [`Self:: last_seen_reference()`] will not be created or updated.
94
94
/// The second field in the returned tuple is the commit object to which the changes were provided.
95
- /// If one would set the ` last_seen_reference()` to that object, the effect is exactly the same
96
- /// as if ` fetch_changes(…)` had been called.
95
+ /// If one would set the [`Self:: last_seen_reference()`] to that object, the effect is exactly the same
96
+ /// as if [`Self:: fetch_changes()`] had been called.
97
97
///
98
98
/// The `progress` and `should_interrupt` parameters are used to provide progress for fetches and allow
99
99
/// these operations to be interrupted gracefully.
@@ -204,16 +204,19 @@ impl Index {
204
204
) )
205
205
}
206
206
207
- /// Similar to ` changes()`, but requires `from` and `to` objects to be provided. They may point
207
+ /// Similar to [`Self:: changes()`] , but requires `from` and `to` objects to be provided. They may point
208
208
/// to either `Commit`s or `Tree`s.
209
209
///
210
210
/// # Returns
211
211
///
212
212
/// A list of atomic changes that were performed on the index
213
213
/// between the two revisions.
214
+ ///
215
+ /// # Grouping and Ordering
216
+ ///
214
217
/// The changes are grouped by the crate they belong to.
215
- /// The order of the changes for each crate are **non- deterministic**.
216
- /// The order of crates is also **non-deterministic**.
218
+ /// The order of the changes for each crate is **deterministic** as they are ordered by line number, ascending .
219
+ /// The order of crates is **non-deterministic**.
217
220
///
218
221
/// If a specific order is required, the changes must be sorted by the caller.
219
222
pub fn changes_between_commits (
@@ -238,7 +241,7 @@ impl Index {
238
241
delegate. into_result ( )
239
242
}
240
243
241
- /// Similar to ` changes()`, but requires `ancestor_commit` and `current_commit` objects to be provided
244
+ /// Similar to [`Self:: changes()`] , but requires `ancestor_commit` and `current_commit` objects to be provided
242
245
/// with `ancestor_commit` being in the ancestry of `current_commit`.
243
246
///
244
247
/// If the invariants regarding `ancestor_commit` and `current_commit` are not upheld, we fallback
@@ -250,6 +253,14 @@ impl Index {
250
253
/// A list of atomic changes that were performed on the index
251
254
/// between the two revisions, but looking at it one commit at a time, along with the `Order`
252
255
/// that the changes are actually in in case one of the invariants wasn't met.
256
+ ///
257
+ /// # Grouping and Ordering
258
+ ///
259
+ /// Note that the order of the changes for each crate is **deterministic**, should they happen within one commit,
260
+ /// as the ordering is imposed to be by line number, ascending.
261
+ /// Typically one commit does not span multiple crates, but if it does, for instance when rollups happen,
262
+ /// then the order of crates is also **non-deterministic**.
263
+ ///
253
264
pub fn changes_between_ancestor_commits (
254
265
& self ,
255
266
ancestor_commit : impl Into < gix:: hash:: ObjectId > ,
@@ -337,10 +348,10 @@ impl Index {
337
348
)
338
349
}
339
350
340
- /// Return all `Change`s that are observed between the last time this method was called
351
+ /// Return all [ `Change`] s that are observed between the last time this method was called
341
352
/// and the latest state of the `crates.io` index repository, which is obtained by fetching
342
353
/// the remote called `origin`.
343
- /// The ` last_seen_reference()` will be created or adjusted to point to the latest fetched
354
+ /// The [`Self:: last_seen_reference()`] will be created or adjusted to point to the latest fetched
344
355
/// state, which causes this method to have a different result each time it is called.
345
356
///
346
357
/// The `progress` and `should_interrupt` parameters are used to provide progress for fetches and allow
@@ -392,8 +403,11 @@ impl Index {
392
403
///
393
404
/// A list of atomic chanes that were performed on the index
394
405
/// between the two revisions.
406
+ ///
407
+ /// # Grouping and Ordering
408
+ ///
395
409
/// The changes are grouped by the crate they belong to.
396
- /// The order of the changes for each crate are **non- deterministic**.
410
+ /// The order of the changes for each crate is **deterministic** as they are ordered by line number, ascending .
397
411
/// The order of crates is also **non-deterministic**.
398
412
///
399
413
/// If a specific order is required, the changes must be sorted by the caller.
0 commit comments