git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: scarf <greenscarf005@gmail.com>, git@vger.kernel.org
Subject: Re: Unable to split then edit hunk in git interactive add
Date: Fri, 24 Nov 2023 15:19:59 +0000	[thread overview]
Message-ID: <b6e24bb6-a497-4d37-a938-cfbcdbe77a9d@gmail.com> (raw)
In-Reply-To: <8d7c8313-0f02-4218-ba2a-1716ada7956f@gmail.com>

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

      reply	other threads:[~2023-11-24 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24  8:16 Unable to split then edit hunk in git interactive add scarf
2023-11-24 15:19 ` Phillip Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6e24bb6-a497-4d37-a938-cfbcdbe77a9d@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=greenscarf005@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).