summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-22 04:04:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-22 04:04:35 (GMT)
commitccc663bc24a3925b818df0ce97a5ba47e221f383 (patch)
treedcb3d702b3f89d4b276a0beeb00c87fdcf6612ab /builtin
parentd226b14d47311d74e2d55059a54594c3fe474b25 (diff)
downloadgit-ccc663bc24a3925b818df0ce97a5ba47e221f383.zip
git-ccc663bc24a3925b818df0ce97a5ba47e221f383.tar.gz
git-ccc663bc24a3925b818df0ce97a5ba47e221f383.tar.bz2
git add: rephrase the "removal will cease to be ignored" warning
Now the logic to decide when to warn has been tightened, we know the user is in a situation where the current and future behaviours will be different. Spell out what happens with these two versions and how to explicitly ask for the behaviour, and suggest "git status" as a way to inspect the current status. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 4242bce..20f459a 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -52,15 +52,22 @@ static int fix_unmerged_status(struct diff_filepair *p,
return DIFF_STATUS_MODIFIED;
}
+static const char *add_would_remove_warning = N_(
+ "You ran 'git add' with neither '-A (--all)' or '--no-all', whose\n"
+"behaviour will change in Git 2.0 with respect to paths you removed from\n"
+"your working tree. Paths like '%s' that are\n"
+"removed are ignored with this version of Git.\n"
+"\n"
+"* 'git add --no-all <pathspec>', which is the current default, ignores\n"
+" paths you removed from your working tree.\n"
+"\n"
+"* 'git add --all <pathspec>' will let you also record the removals.\n"
+"\n"
+"Run 'git status' to check the paths you removed from your working tree.\n");
+
static void warn_add_would_remove(const char *path)
{
- warning(_("In Git 2.0, 'git add <pathspec>...' will also update the\n"
- "index for paths removed from the working tree that match\n"
- "the given pathspec. If you want to 'add' only changed\n"
- "or newly created paths, say 'git add --no-all <pathspec>...'"
- " instead.\n\n"
- "'%s' would be removed from the index without --no-all."),
- path);
+ warning(_(add_would_remove_warning), path);
}
static void update_callback(struct diff_queue_struct *q,