From: Junio C Hamano <gitster@pobox.com>
To: Emily Shaffer <emilyshaffer@google.com>
Cc: git@vger.kernel.org
Subject: Re: Change behavior of git add --patch on newly added file?
Date: Sat, 09 Nov 2019 16:14:53 +0900 [thread overview]
Message-ID: <xmqqpni1ldw2.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <xmqq5zjtn07v.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Sat, 09 Nov 2019 13:27:16 +0900")
Junio C Hamano <gitster@pobox.com> writes:
> Emily Shaffer <emilyshaffer@google.com> writes:
>
>> Should 'git add -p <newly-added-file>' do the same thing as 'git add -N
>> <newly-added-file && git add -p <newly-added-file>'?
> ...
> Patches welcome, but you may want to check with Dscho as there is an
> effort going on to reimplement the entire "add -i" machinery in C.
Oh, having said all that, for a newly added file, all you have is a
hunk that is full of added lines and nothing else, so even 's'plit
interactive subcommand of "add -p" interface would not do anything.
So I am not sure if performing an implicit "add -N" upfront would
help your use case that much. For that, you'd need to extend hunk
splitting UI a bit more, so that the user can split a hunk that only
adds lines into two at a desired point in the hunk.
next prev parent reply other threads:[~2019-11-09 7:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 22:50 Change behavior of git add --patch on newly added file? Emily Shaffer
2019-11-09 4:27 ` Junio C Hamano
2019-11-09 7:14 ` Junio C Hamano [this message]
2019-11-12 18:47 ` Emily Shaffer
2019-11-12 20:16 ` Johannes Schindelin
2019-11-13 1:47 ` Junio C Hamano
2019-11-11 3:41 ` Jeff King
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=xmqqpni1ldw2.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=emilyshaffer@google.com \
--cc=git@vger.kernel.org \
/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).