From: Junio C Hamano <gitster@pobox.com>
To: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Jonathan Nieder <jrnieder@gmail.com>,
Eric James Michael Ritz <lobbyjones@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Tomas Carnecky <tomas.carnecky@gmail.com>
Subject: Re: [RFC] git rm -u
Date: Mon, 21 Jan 2013 01:23:07 -0800 [thread overview]
Message-ID: <7v622qhouc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAA01Csrv26WrrJDAo-1cr+rW6rYFGQZpYgtafEh=Wgtzswdv_g@mail.gmail.com> (Piotr Krukowiecki's message of "Mon, 21 Jan 2013 09:09:42 +0100")
Piotr Krukowiecki <piotr.krukowiecki@gmail.com> writes:
> Do you mean "git add" will be disallowed without "." or ":/" argument?
> Or will this change in future and "git add" without argument will me
> "whole tree", same as ":/" ?
No. This is only about "git add -u<RETURN>", not any other forms of
"git add ...with or without other args...".
"git add -u<RETURN>" historically meant, and it still means, to
"update the index with every change in the working tree", even when
you are in a subdirectory.
Back when "git add -u" was invented, we didn't have the ":/", which
lets us tell commands that take pathspecs "I want everything from
the top of the working tree.". If "git add -u<RETURN>" limited its
operation to the current directory, after working everywhere in the
working tree, cd'ing around and ending up to be in a subdirectory
somwhere deep, you had to "cd ../../.. && git add -u", which was
cumbersome. If "git add -u" always meant the whole tree, limiting
it to the current directory with "git add -u .<RETURN>" was easy,
and that is why the default was chosen to the "whole tree".
Because we have ":/" these days, changing something that limits its
action to the current directory by default to instead work on the
whole tree no longer makes much sense. That is, if we _were_ to
change "git add -u<RETURN>", it would be in the opposite direction,
i.e. to update the index only with the paths below the current
directory.
Such a change has to be done carefully. Existing users do expect
the current behaviour, so we have to first _break_ their fingers and
habits and train them to say "add -u :/" when they mean the whole
tree operation. Silently accepting "add -u" and changing its
meaning to update the index only with the paths below the current
directory will cause them trouble by leaving changes they _thought_
they added out of the index, and is an unacceptable change.
The first step of migration is "git add -u<RETURN>" that loudly
warns, so that uses of that form in scripts are updated before the
second step to avoid a flag-day breakage and start traing fingers
and habits of the users.
The second step is to make "add -u<RETURN>" fail, again with a
message that tells users to be explicit and add ":/" or "." at the
end if they mean "the whole tree" or "the current directory".
After keeping Git in that secnd step for sufficiently long time to
train users to type ":/" or "." explicitly, we can then finally
switch the default of "git add -u<RETURN>" to limit it to the
current directory, instead of failing the command.
next prev parent reply other threads:[~2013-01-21 9:23 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-19 21:35 [RFC] git rm -u Eric James Michael Ritz
2013-01-19 21:47 ` Tomas Carnecky
2013-01-19 21:49 ` Antoine Pelisse
2013-01-19 21:56 ` Eric James Michael Ritz
2013-02-25 6:54 ` Junio C Hamano
2013-02-25 18:54 ` Antoine Pelisse
2013-02-25 19:07 ` Matthieu Moy
2013-02-25 19:21 ` Antoine Pelisse
2013-02-25 19:39 ` Matthieu Moy
2013-02-25 19:47 ` Junio C Hamano
2013-01-19 21:49 ` Jonathan Nieder
2013-01-19 22:01 ` Eric James Michael Ritz
2013-01-20 11:32 ` Matthieu Moy
2013-01-20 18:42 ` Junio C Hamano
2013-01-20 21:27 ` Junio C Hamano
2013-01-20 22:17 ` Martin von Zweigbergk
2013-01-21 8:44 ` Matthieu Moy
2013-01-20 18:53 ` Junio C Hamano
2013-01-20 19:21 ` Eric James Michael Ritz
2013-01-21 8:09 ` Piotr Krukowiecki
2013-01-21 8:37 ` Matthieu Moy
2013-01-21 9:23 ` Junio C Hamano [this message]
2013-01-21 19:01 ` Junio C Hamano
2013-01-21 20:03 ` Matthieu Moy
2013-01-21 23:18 ` Junio C Hamano
2013-01-21 19:10 ` Piotr Krukowiecki
2013-01-21 12:00 ` [RFC/PATCH] add: warn when -u or -A is used without filepattern Matthieu Moy
2013-01-21 15:00 ` Robin Rosenberg
2013-01-21 15:16 ` Matthieu Moy
2013-01-21 20:29 ` Robin Rosenberg
2013-01-21 19:12 ` Junio C Hamano
2013-01-21 19:34 ` Piotr Krukowiecki
2013-01-21 20:06 ` Matthieu Moy
2013-01-21 20:10 ` Matthieu Moy
2013-01-21 22:22 ` Jonathan Nieder
2013-01-22 7:39 ` Matthieu Moy
2013-01-25 10:49 ` [PATCH v2] " Matthieu Moy
2013-01-25 19:27 ` Junio C Hamano
2013-01-27 16:10 ` Matthieu Moy
2013-01-27 20:33 ` Junio C Hamano
2013-01-28 8:48 ` Matthieu Moy
2013-01-28 9:16 ` [PATCH v3] " Matthieu Moy
2013-01-28 9:20 ` Jonathan Nieder
2013-01-28 12:47 ` Michael J Gruber
2013-01-28 18:07 ` Junio C Hamano
2013-01-28 18:25 ` Matthieu Moy
2013-01-28 18:31 ` Junio C Hamano
2013-02-14 23:36 ` Junio C Hamano
2013-02-14 23:55 ` Junio C Hamano
2013-02-15 10:00 ` Matthieu Moy
2013-01-27 12:22 ` [PATCH v2] " Jonathan Nieder
2013-01-22 1:10 ` [RFC/PATCH] " Duy Nguyen
2013-01-22 1:51 ` 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=7v622qhouc.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=lobbyjones@gmail.com \
--cc=piotr.krukowiecki@gmail.com \
--cc=tomas.carnecky@gmail.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 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).