Thread (2 messages) 2 messages, 2 authors, 2023-11-24

Re: Unable to split then edit hunk in git interactive add

From: Phillip Wood <hidden>
Date: 2023-11-24 15:20:04

On 24/11/2023 08:16, scarf wrote:
|Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
Thanks for taking the time to report this. While it is a known 
limitation of "git add -p" that editing a hunk after splitting it can 
cause problems (see below) I am unable to reproduce this particular bug.

When a hunk is split the resulting hunks share the context lines around 
the split. The trailing context lines of the first hunk are the same 
lines as the leading context of the second hunk. If the shared context 
is edited then the lines no-longer match between the hunks which means 
they cannot be applied. In general it is better to avoid splitting a 
hunk if you plan to edit it.

Best Wishes

Phillip
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help