[mini.diff] Unstage hunks +signs #2052
Replies: 1 comment 3 replies
-
|
I remember trying really hard to design 'mini.diff' in such a way that it would support Git unstaging. In the end any idea I head (if any, don't remember the specifics) was too complex either from the code point of view or design. My main problem with unstaging hunks directly from the buffer is that staged hunks need to be visualized (as a sign or highlighted number) in order to be useful. And it feels confusing to me to have regular and staged hunks mixed like that. Especially with a more general than a Git model of 'mini.diff'. Now that you're mentioning a different source... A more approachable way of doing this might be to:
This sounds interesting, but not sure if this is a good fit for either 'mini.diff' or 'mini.git'. If anything, 'mini.git' sounds closer. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
About
I think of this feature as something like Planned Modules.
I’m sure you’ve already put a lot of thought into how to implement this, but it seems like it could be done through a pipeline with two sources. As far as I understand, the sources currently work on a
stop_at_firstprinciple, but if we could run two sources sequentially, unstaging a hunk would become possible.The idea is to calculate both sources, with the first defined one taking precedence, effectively overlaying the index source over the HEAD commit files. I haven’t thought this through in depth yet, and there’s still a lot to figure out, especially around motions and highlights for each source. I'm also concerned about the performance of this approach.
So, was this concept considered when creating
mini.diff?P.S. I don’t use every feature of
mini.diff, like overlay, but even so, I really like it. Great work 💥🚀Illustration
Beta Was this translation helpful? Give feedback.
All reactions