All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emily Shaffer <emilyshaffer@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Change behavior of git add --patch on newly added file?
Date: Tue, 12 Nov 2019 10:47:20 -0800	[thread overview]
Message-ID: <20191112184720.GB38770@google.com> (raw)
In-Reply-To: <xmqq5zjtn07v.fsf@gitster-ct.c.googlers.com>

On Sat, Nov 09, 2019 at 01:27:16PM +0900, Junio C Hamano wrote:
> 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>'?
> 
> Probably.  
> 
> I originally wrote "git add -i" with the intention that the
> interactive mode is _the_ primary interface to the machinery, so the
> expected way to work with a new file was "git add -i", tell the
> command to add that <newly-added-file>, and do the "patch" thing
> using the interactive subcommand to do so within the "git add -i"
> session.
> 
> Later people liked (only) the patch part, and "git add -p" (and
> various "--patch" options that invoke "add -p" internally from other
> commands like "checkout", "reset" were added) was born.  I think
> nobody thought things through when they did so.
> 
> If I were designing "git add -p" from scratch and explicitly asked
> not to do the other parts of the "--interactive" feature, I would
> imagine "add -N && add -p" combination is what I would make it
> mimic.
> 
> 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.

Ah, this is a compelling point. I imagine the landscape will be fairly
different when that effort is finished.


From the replies, it sounds like it's a favorable change, but it makes
sense to wait on it considering the refactor to use C. Thanks, all.

 - Emily

  parent reply	other threads:[~2019-11-12 18:47 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
2019-11-12 18:47   ` Emily Shaffer [this message]
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

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

  git send-email \
    --in-reply-to=20191112184720.GB38770@google.com \
    --to=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.