diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2024-09-14 12:25:02 +0200 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-09-16 15:23:18 +1000 |
| commit | 54992c08aecb2fc91aecacccc15d3a17ae7390dc (patch) | |
| tree | fb8cc822bb2105111b93bb1f1ad96759ac22262f /doc | |
| parent | aac32e0f5ad3332775a4f3e3092a4fd8a6c0db62 (diff) | |
rc git: teach "git apply" to work on content, not just diffs
Staging/unstaging/reverting (parts of) the current buffer's file can
be a common use case.
Today "git apply" can do that based on a selection within a diff.
When the selection is on uncommitted content, we can probably assume
that the intent is to use the part of the selection that overlaps
with the +-side of "git diff" (or "git diff --cached" for
"git apply --cached").
Make "git apply" treat selections as content if the buffile is
tracked by Git. This differentiator is not perfect but I don't know
why anyone would want to use the existing "git apply" semantics on
a tracked file. Maybe we should pick a different name.
This feature couples well with "git show-diff", which shows all
lines with unstaged changes (in future it should probably show staged
changes as well).
Whereas on diffs, "git apply" stages the entire hunk if the selection
contains no newline, this does not happen when operating on content.
I didn't yet try implementing that. I guess the hunks are not as
explicit here.
Closes #5225
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/pages/changelog.asciidoc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc index 3a6804e5..f443f207 100644 --- a/doc/pages/changelog.asciidoc +++ b/doc/pages/changelog.asciidoc @@ -5,8 +5,10 @@ released versions. == Development version -* Expose env vars that are mentionned in the arguments passed to shell expansions +* Expose env vars that are mentioned in the arguments passed to shell expansions * Support for colored double underlines +* `git apply` can now operate on selected changes in the current buffer's + file (useful for quick (un)staging and reverting) == Kakoune 2024.05.18 |
