git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2011, 05:19 UTC
Message-ID
<7v1v1yifc9.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<7v7hbqifej.fsf_-_@alter.siamese.dyndns.org>

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
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 11 of 15 in “What's cooking in git.git (Mar 2011, #02; Sun, 20)”
  1. Junio C HamanoMar 20, 2011
  2. Jens LehmannMar 20, 2011
  3. Junio C HamanoMar 20, 2011
  4. Junio C HamanoMar 20, 2011
  5. Matthieu MoyMar 20, 2011
  6. Junio C HamanoMar 21, 2011
  7. Jeff KingMar 21, 2011
  8. Junio C HamanoMar 21, 2011
  9. add: make "add -u/-A" update full tree without pathspecJunio C Hamano, Mar 23, 2011
  10. add: make "add -u/-A" update full tree without pathspec (step 2)Junio C Hamano, Mar 23, 2011
  11. add: make "add -u/-A" update full tree without pathspec (step 3)Junio C Hamano, Mar 23, 2011
  12. Nguyen Thai Ngoc DuyMar 23, 2011
  13. Junio C HamanoMar 23, 2011
  14. Ævar Arnfjörð BjarmasonMar 22, 2011
  15. Junio C HamanoMar 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.