You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// hunks from `hunks_to_keep` that couldn't be associated with `worktree_hunks_no_context` because they weren't included.
349
350
///
350
351
/// `worktree_hunks` is the hunks with a given amount of context, usually 3, and it's used to quickly select original hunks
351
-
/// without selection.
352
-
/// `hunks_to_keep` indicate that they are a selection by marking the other side with `0,0`, i.e. `-1,2 +0,0` selects old `1,2`,
353
-
/// and `-0,0 +2,3` selects new `2,3`.
352
+
/// without sub-selection, which is needed when no sub-selections are specified for all hunks. Those with sub-selections and without
353
+
/// can be mixed freely though.
354
+
///
355
+
/// `hunks_to_keep` indicate that they are a selection of either old or new by marking the other side with `0,0`, i.e. `-1,2 +0,0` selects *old* `1,2`,
356
+
/// and `-0,0 +2,3` selects *new* `2,3`. Our job here is to rebuild the original hunk selections from that, as if the user had
357
+
/// selected them in the UI, and we want to recreate the hunks that would match their selection.
354
358
///
355
359
/// The idea here is that `worktree_hunks_no_context` is the smallest-possible hunks that still contain the designated
356
360
/// selections in the old or new image respectively. This is necessary to maintain the right order in the face of context lines.
357
361
/// Note that the order of changes is still affected by what which selection comes first, i.e. old and new, or vice versa, if these
0 commit comments