Closed SevereOverfl0w closed 6 years ago
Hi,
not sure to understand. It seems you are asking for one of the main vimagit feature.
You can stage part of hunk, either:
v
, then staging selection with S
M
, then staging selection with S
L
See https://github.com/jreybert/vimagit#visual-selection
You can even edit a line before staging, allowing you stage part of line, see https://github.com/jreybert/vimagit#inline-modifications
I possibly just ran into an edge case. I solved my problem by using a visual selection at the time though.
The feature I was really asking for was the ability for vimagit to break down the hunk for me, because there's reassurance in seeing the hunk first I think, I'm also quite lazy.
On February 1, 2018 1:17:41 PM GMT+00:00, "Jérôme Reybert" notifications@github.com wrote:
Hi,
not sure to understand. It seems you are asking for one of the main vimagit feature.
You can stage part of hunk, either:
- by visually selecting lines with
v
, then staging selection withS
- by marking lines with
M
, then staging selection withS
- by staging line by line, with
L
See https://github.com/jreybert/vimagit#visual-selection
You can even edit a line before staging, allowing you stage part of line, see https://github.com/jreybert/vimagit#inline-modifications
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jreybert/vimagit/issues/158#issuecomment-362262951
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
You can also force git to shrink/enlarge the diff context, using the keys + and -. Then, you will get smaller/larger hunks.
But you can't say to vimagit (which means saying to git in the end): split the display of this hunk at this point.
OK, I now understand what you meant (I did not know the s
command in git add patch
interactive mode.
Well, maybe the shrink/enlarge mapping could update only the current hunk.
Is this feature a real need for you?
The +/- was something I tried, but didn't have the desired effect. Admittedly, it didn't seem to do anything, so I might have been doing something wrong.
Strong need? I'm not sure. I've only applied vimagit a handful of times, but it's come up on about 40% of my attempts at using it.
It would be convenient to have a command for splitting hunks into smaller hunks. Much like the interactive patch command does with
s
.I've had a few cases where lines changed close to each other, but were fully independent.