From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Ariel <asgit@dsgml.com>, git@vger.kernel.org
Subject: Re: git add -p with new file
Date: Sat, 10 Dec 2016 14:04:33 -0800 [thread overview]
Message-ID: <xmqq37hvphji.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161210085556.nwg3pbay367jqin5@sigill.intra.peff.net> (Jeff King's message of "Sat, 10 Dec 2016 03:55:56 -0500")
Jeff King <peff@peff.net> writes:
> On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote:
> ...
>> But it doesn't have to be that way. You could make add -p identical to add
>> without options, except the -p prompts to review diffs first.
>
> The question is whether you would annoy people using "-p" if you started
> including untracked files by default. I agree because it's inherently an
> interactive process that we can be looser with backwards compatibility.
It might be interactive, but it will be irritating that we suddenly
have to see hundreds of lines in an untracked file before we are
asked to say "no I do not want to add this file" and have to do so
for all the untracked files that happen to match the given pathspec.
It might make it less irritating if one of the interactive choices
offered in the first prompt were N that tells the command: "No,
ignore all the untracked paths", though. I dunno.
Also, because "git add -p" (no pathspec) is NOT a no-op, the
similarity Ariel sees with "git add" (no other options) does not
hold. As you kept explaining (but perhaps not successfully being
understood yet), "add -p" works like "add -u", and it will make the
command incoherent if we allowed "git add -p <path>" to add new
paths, exactly because "git add -u <path>" does not do so. Of
course that can be fixed by allowing "git add -u" to also add new
paths that match pathspec.
Of course, Ariel can vote for making "add -p" more like "add" (with
no options) than "add -u". I _think_ it is a better way to solve
the incoherence than making "add -u" to add new paths. But what it
means is that "add -p <paths>" works on both tracked and untracked
paths that match the given pathspec <paths>, and also "add -p" (no
pathspec) must become a no-op (because "add" without option and
pathspec is).
next prev parent reply other threads:[~2016-12-10 22:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 1:18 git add -p with new file Ariel
2016-12-07 9:22 ` Duy Nguyen
2016-12-09 18:26 ` Ariel
2016-12-12 20:24 ` Stephan Beyer
2016-12-09 14:11 ` Jeff King
2016-12-09 18:43 ` Ariel
2016-12-10 8:55 ` Jeff King
2016-12-10 22:04 ` Junio C Hamano [this message]
2016-12-11 13:00 ` Jeff King
2016-12-12 20:31 ` Stephan Beyer
2016-12-13 17:33 ` Jeff King
2016-12-13 18:48 ` Junio C Hamano
2016-12-13 18:56 ` Jeff King
2016-12-13 19:12 ` Junio C Hamano
2016-12-13 19:21 ` git add -p with unmerged files (was: git add -p with new file) Stephan Beyer
2016-12-13 19:49 ` Jeff King
2016-12-13 19:59 ` git add -p with unmerged files Junio C Hamano
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=xmqq37hvphji.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=asgit@dsgml.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.