From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>, git@vger.kernel.org
Subject: [PATCH] add: make "add -u/-A" update full tree without pathspec (step 3)
Date: Tue, 22 Mar 2011 22:19:18 -0700 [thread overview]
Message-ID: <7v1v1yifc9.fsf_-_@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v7hbqifej.fsf_-_@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Tue, 22 Mar 2011 22:17:56 -0700")
Now long after 1.8.0 happened, people should have got used to the
new default behaviour and it is no longer necessary to give the
migration advice anymore.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* And this concludes the two-year long series from the future ;-)
builtin/add.c | 23 +----------------------
t/t2200-add-update.sh | 3 +--
2 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index 1d76d55..71f3aa5 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -364,27 +364,6 @@ static int add_files(struct dir_struct *dir, int flags)
return exit_status;
}
-static const char *warn_add_uA_180_migration_msg[] = {
- "Since release 1.8.0, running 'git add -u' (or 'git add -A')",
- "from a subdirectory without giving any pathspec takes effect",
- "on the whole working tree, not just the part under the current",
- "directory. If you want to limit the operation to the current",
- "directory, please add '.' at the end of the command, like",
- "'git add -u .'",
- "Alternatively, you can set add.treewideupdate configuration",
- "variable to 'false' to keep using the old behaviour.",
- "This warning will be issued until you set the variable",
- "to either 'true' or 'false'."
-};
-
-static int warn_180_migration(void)
-{
- int i;
- for (i = 0; i < ARRAY_SIZE(warn_add_uA_180_migration_msg); i++)
- warning("%s", warn_add_uA_180_migration_msg[i]);
- return 1; /* default to "true" (tree-wide, i.e. not local) */
-}
-
int cmd_add(int argc, const char **argv, const char *prefix)
{
int exit_status = 0;
@@ -419,7 +398,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
whole_tree_add = 1;
if (prefix) {
if (default_tree_wide_update < 0)
- default_tree_wide_update = warn_180_migration();
+ default_tree_wide_update = 1;
if (!default_tree_wide_update)
whole_tree_add = 0;
}
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 97478cd..8479ff2 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -81,7 +81,6 @@ test_expect_success 'change gets noticed' '
'
test_expect_success 'update from a subdirectory without pathspec (no config)' '
- # This test needs to be adjusted when warning message is removed
test_might_fail git config --remove add.treewideupdate &&
test_might_fail git reset check dir1 &&
echo changed >check &&
@@ -93,7 +92,7 @@ test_expect_success 'update from a subdirectory without pathspec (no config)' '
git diff-files --name-only dir1 check >actual &&
: >expect &&
test_cmp expect actual &&
- grep warning expect.warning
+ ! grep warning expect.warning
'
test_expect_success 'update from a subdirectory without pathspec (local)' '
--
1.7.4.1.586.g183369
next prev parent reply other threads:[~2011-03-23 5:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-20 19:49 What's cooking in git.git (Mar 2011, #02; Sun, 20) Junio C Hamano
2011-03-20 20:43 ` Jens Lehmann
2011-03-20 21:06 ` Junio C Hamano
2011-03-20 21:22 ` Junio C Hamano
2011-03-20 21:36 ` Matthieu Moy
2011-03-21 0:06 ` Junio C Hamano
2011-03-21 11:16 ` Jeff King
2011-03-21 14:28 ` Junio C Hamano
2011-03-23 0:02 ` [PATCH] add: make "add -u/-A" update full tree without pathspec Junio C Hamano
2011-03-23 5:17 ` [PATCH] add: make "add -u/-A" update full tree without pathspec (step 2) Junio C Hamano
2011-03-23 5:19 ` Junio C Hamano [this message]
2011-03-23 14:02 ` [PATCH] add: make "add -u/-A" update full tree without pathspec (step 3) Nguyen Thai Ngoc Duy
2011-03-23 15:54 ` Junio C Hamano
2011-03-22 10:57 ` What's cooking in git.git (Mar 2011, #02; Sun, 20) Ævar Arnfjörð Bjarmason
2011-03-22 18:00 ` 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=7v1v1yifc9.fsf_-_@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.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).