[PATCH] add: make "add -u/-A" update full tree without pathspec (step 3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

 * 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]