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
Some packages exist for displaying diff information directly in file-visiting buffers. diff-hl is the one I use.
This is certainly very nice, since you can see which lines were added or modified and that some line(s) before some remaining line were removed. But this does not give you the full story, since you cannot see the old versions, for that you have to look at the actual diff.
Diffs a certainly nice, since you can see the context of a change, including the old version. Sometimes you need a little more context, and then arguments such as --function-context come in handy. But sometimes you want even more context, and for that you have to switch back to the file-visiting buffer. Also it currently isn't possible to edit a diff directly (but see #2938), so here too you have to switch back to the diff.
Then again you might not want to see all the context... more on that later.
In a sense there already exists support for showing diffs inside a file-visiting buffer, or rather there exists a package smerge that prettifies diffs that are shown inside such buffers because the visited file contains them. That is the case when a merge conflict occurs and git puts both (or all three) versions into the file.
But while there are some similarities between smerge and the feature I am proposing here - in both cases commands such as "go to next change" are highly desirable, for example - they are also very different.
Most importantly in the case of smerge the diff markup is actual text that is part of the buffer and file, while in the case of the feature proposed here, the diff stuff has to be kept out of the file and only be displayed using overlays (that's only one implementation strategy). That makes this quite a bit harder.
The "diff overlay" feature proposed here, lets give it the nickname sdiff, should be implemented as a minor-mode. Lets think about some of its features:
Conflicts should be collapsible like in Magit buffers.
But unlike in Magit buffers it probably makes less sense to collapse complete hunks and more sense to collapse only "sides" of the change.
At times it might also be nice to collapse the "additional context", which you don't get in actual diffs. After collapsing the "context" and fully expanding the "hunks", the buffer would look similar to how the diff itself would look in Magit; there are just some additional "context headings" sprinkled in between.
(more to come)
Big open questions:
What is the relationship to packages such as diff-hl? Do we contribute to that, fork it, implement an alternative?
(more to come)
The text was updated successfully, but these errors were encountered:
Some packages exist for displaying diff information directly in file-visiting buffers.
diff-hl
is the one I use.This is certainly very nice, since you can see which lines were added or modified and that some line(s) before some remaining line were removed. But this does not give you the full story, since you cannot see the old versions, for that you have to look at the actual diff.
Diffs a certainly nice, since you can see the context of a change, including the old version. Sometimes you need a little more context, and then arguments such as
--function-context
come in handy. But sometimes you want even more context, and for that you have to switch back to the file-visiting buffer. Also it currently isn't possible to edit a diff directly (but see #2938), so here too you have to switch back to the diff.Then again you might not want to see all the context... more on that later.
In a sense there already exists support for showing diffs inside a file-visiting buffer, or rather there exists a package
smerge
that prettifies diffs that are shown inside such buffers because the visited file contains them. That is the case when a merge conflict occurs and git puts both (or all three) versions into the file.But while there are some similarities between
smerge
and the feature I am proposing here - in both cases commands such as "go to next change" are highly desirable, for example - they are also very different.Most importantly in the case of
smerge
the diff markup is actual text that is part of the buffer and file, while in the case of the feature proposed here, the diff stuff has to be kept out of the file and only be displayed using overlays (that's only one implementation strategy). That makes this quite a bit harder.The "diff overlay" feature proposed here, lets give it the nickname
sdiff
, should be implemented as a minor-mode. Lets think about some of its features:Big open questions:
diff-hl
? Do we contribute to that, fork it, implement an alternative?The text was updated successfully, but these errors were encountered: