From: Junio C Hamano <gitster@pobox.com>
To: "Raymond E. Pasco" <ray@ameretat.dev>
Cc: "Thomas Sullivan" <tom@msbit.com.au>, <git@vger.kernel.org>,
"Phillip Wood" <phillip.wood123@gmail.com>
Subject: Re: git add intent-to-add then git add patch no longer allows edit
Date: Fri, 21 Aug 2020 09:27:48 -0700 [thread overview]
Message-ID: <xmqqmu2o9d6j.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <C52FB27V04G0.2ML0PLGDE71MG@ziyou.local> (Raymond E. Pasco's message of "Fri, 21 Aug 2020 01:25:41 -0400")
"Raymond E. Pasco" <ray@ameretat.dev> writes:
> I fixed half of this in a topic that's on master now (it errors out
> entirely if you try to stage it at all in 2.28.0),
Yup, thanks for that one.
> but new file diffs
> still aren't splittable into hunks. Phillip Wood (on cc) is looking into
> that; the tricky part is that when split into hunks only the first hunk
> actually staged can be a "new file" patch.
Out of a change that adds a file with three parts A, B and C (in
this order), you could pick the parts A and C, while leaving the
change to further add B in the middle, and create a patch to add a
file that has A and C, and apply that to the index alone (i.e. "add
-p", pick A and C, and "add" that part by applying that "new file"
diff). After that, the path is no longer i-t-a but has the real
contents (i.e. part A followed by part C), so further "add -p" would
see the difference between the index and the working tree as a
modification patch.
So as long as you could come up with a good UI to pick parts from a
single hunk "new file" diff, "the second and later application must
be done as modification" should fall out naturally, no?
next prev parent reply other threads:[~2020-08-21 16:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 4:27 git add intent-to-add then git add patch no longer allows edit Thomas Sullivan
2020-08-21 5:25 ` Raymond E. Pasco
2020-08-21 16:27 ` Junio C Hamano [this message]
2020-08-23 16:03 ` Phillip Wood
2020-08-24 16:23 ` Raymond E. Pasco
2020-08-24 17:28 ` Phillip Wood
2020-08-24 21:03 ` Raymond E. Pasco
2020-09-04 10:05 ` Phillip Wood
2020-09-04 6:56 ` Johannes Schindelin
2020-09-06 17:10 ` Junio C Hamano
2020-09-07 18:00 ` Phillip Wood
2020-09-08 16:05 ` Junio C Hamano
2020-09-08 19:52 ` Johannes Schindelin
2020-09-08 22:00 ` Junio C Hamano
2020-09-09 9:40 ` Phillip Wood
2020-09-05 18:36 ` Raymond E. Pasco
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmu2o9d6j.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=phillip.wood123@gmail.com \
--cc=ray@ameretat.dev \
--cc=tom@msbit.com.au \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).