From: Michael J Gruber <git@drmicha.warpmail.net>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [RFC/PATCH] git add: notice removal of tracked paths by default
Date: Wed, 20 Apr 2011 10:18:15 +0200 [thread overview]
Message-ID: <4DAE96C7.9070904@drmicha.warpmail.net> (raw)
In-Reply-To: <20110420055758.GC28597@sigill.intra.peff.net>
Jeff King venit, vidit, dixit 20.04.2011 07:57:
> On Tue, Apr 19, 2011 at 12:18:20PM -0700, Junio C Hamano wrote:
>
>> Make "git add" to pretend as if "-A" is given when there is a pathspec on
>> the command line. "git add" without any argument continues to be a no-op.
>
> I like your proposed semantics much better. I remember many times early
> on with git cursing the current behavior, until I finally trained myself
> to do "git add -A".
>
>> This might not be such a good idea, and I do not have a strong opinion
>> for this change, but merely a weatherbaloon.
>>
>> Having "git add ." notice removals might lead to mistakes ("oh, I only
>> meant to record additions, and didn't want to record the removals"), but
>> at the same time, leaving it not notice removals would lead to mistakes
>> by the other people ("I added, removed and edited different paths, but
>> why only removals are ignored?").
>
> I suspect most people will want the new semantics, because no matter
> what your overall workflow, it is generally going to be some variant of:
>
> 1. hack hack hack
> 2. tell git about changes
>
> And you don't really care about deletions versus modifications, you just
> want them all added. But you probably _do_ care about additions versus
> modififications, since step 1 often involves creating cruft that should
> remain untracked (whereas it very rarely involves _deleting_ precious
> files). And that's why we have "add -u", which should not go away.
>
> My biggest worry would be people saying "eh? Add removes my files? That
> makes no sense!" But we more or less already have that with "add -u",
> and I think people have learned to accept that it is about "add the
> current state to the index" and not "add files to git".
>
> -Peff
Yes, that behaviour makes much more sense.
That means that "git add -A" is "git add ." and "-A" is not needed
otherwise any more, right? makes sense, too, and we could probably
deprecate (i.e. stop advertising) it.
Michael
prev parent reply other threads:[~2011-04-20 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 19:18 [RFC/PATCH] git add: notice removal of tracked paths by default Junio C Hamano
2011-04-19 19:46 ` Sverre Rabbelier
2011-04-19 21:41 ` Junio C Hamano
2011-04-19 21:47 ` Sverre Rabbelier
2011-04-20 5:57 ` Jeff King
2011-04-20 8:18 ` Michael J Gruber [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=4DAE96C7.9070904@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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 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).