diff options
| author | Kyle Meyer <kyle@kyleam.com> | 2024-08-04 11:20:29 -0400 |
|---|---|---|
| committer | Kyle Meyer <kyle@kyleam.com> | 2024-08-04 11:20:29 -0400 |
| commit | 87fe66662a1068239e7eafdf26fc0d3ef310a4e7 (patch) | |
| tree | b09fc9565c45d0060734ae91b06afa2f8e58582f /docs/RelNotes/4.0.0.org | |
| parent | 5c364eaad728a2dffe181ee5a8805a20866de35f (diff) | |
magit-diff-working-tree: Change diff type to committed
magit-diff-range with a single revision and magit-diff-working-tree
both show a diff between the revision and the working tree. Whether
magit-reverse aborted in these buffers used to be determined by
whether the specified revision resolved to HEAD. If so, magit-reverse
aborted with "Cannot reverse unstaged changes".
magit-reverse aborting here wasn't entirely right because a diff of
HEAD versus the working tree may contain staged changes too.
e94b6ebf (Record diff-type in magit-diff-mode buffers, 2023-03-18)
moved magit-diff-range and magit-diff-working-tree in different
directions. With that change, magit-diff-range with any revision,
including HEAD, allows reversing. On the other hand,
magit-diff-working-tree with any revision forbids reversing.
Update magit-diff-working-tree to pass `committed' instead of
`unstaged' for the diff type. As a description, `committed' is a bit
off (the diff can include a mix of unstaged, staged, and committed
changes), but it allows reversing and matches what magit-diff-range
does.
For a diff of any revision against the working tree, magit-apply is
bound to fail. Before e94b6ebf, magit-apply used to abort when the
diff was between _HEAD_ and the working tree. After e94b6ebf and this
change, magit-apply leaves the failure to git-apply. To abort early,
we could mark working tree diffs with a distinct diff type, but
leaving the failure to apply time is good enough, at least for now.
Closes #5090.
Diffstat (limited to 'docs/RelNotes/4.0.0.org')
| -rw-r--r-- | docs/RelNotes/4.0.0.org | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/RelNotes/4.0.0.org b/docs/RelNotes/4.0.0.org index 30e8c8c..682e81e 100644 --- a/docs/RelNotes/4.0.0.org +++ b/docs/RelNotes/4.0.0.org @@ -171,6 +171,9 @@ - Improve the diff shown while committing. #3246 +- ~magit-reverse~ is now permitted in diff buffers between HEAD and + the working tree. e94b6ebfdb #5090 + - Register a ~bookmark-handler-type~ for our handler. adf5848ea7 - Added new option ~magit-log-merged-commit-count~. #4711 |
