From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 3/4] add: make "add -u/-A" update full tree without pathspec (step 2)
Date: Wed, 6 Apr 2011 18:16:35 -0700 [thread overview]
Message-ID: <1302138996-10006-4-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1302138996-10006-1-git-send-email-gitster@pobox.com>
Flip the default behaviour when "git add -u/-A" is run without a
pathspec from a subdirectory to tree-wide, and reword the advice
message.
We will need to keep the advice message for a while to help people
who skipped the 1.8.0 boundary.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/add.c | 8 ++++----
t/t2200-add-update.sh | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index f58d1cf..6e6cdc0 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -360,13 +360,13 @@ static int add_files(struct dir_struct *dir, int flags)
}
static const char *warn_add_uA_180_migration_msg[] = {
- "In release 1.8.0, running 'git add -u' (or 'git add -A') from",
- "a subdirectory without giving any pathspec WILL take effect",
+ "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. Please make it a habit to add '.' when you want to",
"limit the operation to the current directory and below.",
"You can use ':/' at the end of the command to affect the operation",
- "on the whole working tree.",
+ "on the whole working tree, if you want to be explicit.",
};
static int warn_180_migration(void)
@@ -374,7 +374,7 @@ 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 0; /* default to "no" (not tree-wide, i.e. local) */
+ return 1; /* default to "true" (tree-wide, i.e. not local) */
}
int cmd_add(int argc, const char **argv, const char *prefix)
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index f7711ba..a601394 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -91,7 +91,7 @@ test_expect_success 'update from a subdirectory without pathspec' '
git add -u 2>../expect.warning
) &&
git diff-files --name-only dir1 check >actual &&
- echo check >expect &&
+ : >expect &&
test_cmp expect actual &&
grep warning expect.warning
'
--
1.7.5.rc1
next prev parent reply other threads:[~2011-04-07 1:17 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 1:16 [PATCH 0/4] Redoing the "add -u" migration plan Junio C Hamano
2011-04-07 1:16 ` [PATCH 1/4] magic pathspec: add tentative ":/path/from/top/level" pathspec support Junio C Hamano
2011-04-07 1:40 ` Junio C Hamano
2011-04-07 13:09 ` Nguyen Thai Ngoc Duy
2011-04-07 18:28 ` Junio C Hamano
2011-04-08 11:39 ` Nguyen Thai Ngoc Duy
2011-04-07 13:23 ` Nguyen Thai Ngoc Duy
2011-04-07 16:18 ` Junio C Hamano
2011-04-08 12:00 ` Nguyen Thai Ngoc Duy
2011-04-08 15:05 ` Junio C Hamano
2011-04-08 15:39 ` Nguyen Thai Ngoc Duy
2011-04-08 16:37 ` Junio C Hamano
2011-04-08 17:02 ` Nguyen Thai Ngoc Duy
2011-04-07 1:16 ` [PATCH 2/4] add -u: get rid of "treewideupdate" configuration Junio C Hamano
2011-04-08 17:54 ` Jeff King
2011-04-08 19:27 ` Junio C Hamano
2011-04-08 20:24 ` Jeff King
2011-04-08 22:22 ` Junio C Hamano
2011-04-08 22:32 ` Jeff King
2011-04-08 22:37 ` Junio C Hamano
2011-04-08 23:18 ` Junio C Hamano
2011-04-09 4:38 ` Nguyen Thai Ngoc Duy
2011-04-09 4:56 ` Junio C Hamano
2011-04-09 5:05 ` Nguyen Thai Ngoc Duy
2011-04-09 21:34 ` Junio C Hamano
2011-04-09 4:58 ` Nguyen Thai Ngoc Duy
2011-04-09 5:20 ` Junio C Hamano
2011-04-09 10:15 ` Nguyen Thai Ngoc Duy
2011-04-09 11:24 ` Nguyen Thai Ngoc Duy
2011-04-09 21:38 ` Junio C Hamano
2011-05-03 7:52 ` Nguyen Thai Ngoc Duy
2011-05-03 15:01 ` Junio C Hamano
2011-05-03 16:17 ` Nguyen Thai Ngoc Duy
2011-04-07 1:16 ` Junio C Hamano [this message]
2011-04-07 1:16 ` [PATCH 4/4] add: make "add -u/-A" update full tree without pathspec (step 3) 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=1302138996-10006-4-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/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).