From: Junio C Hamano <gitster@pobox•com>
To: Jonathan Nieder <jrnieder@gmail•com>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail•com>,
git@vger•kernel.org, tfnico@gmail•com
Subject: Re: [PATCH] add: don't complain when adding empty project root
Date: Thu, 26 Dec 2013 11:24:32 -0800 [thread overview]
Message-ID: <xmqqlhz7ct5b.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqtxdvcuj0.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Thu, 26 Dec 2013 10:54:43 -0800")
Junio C Hamano <gitster@pobox•com> writes:
> Regarding "git add --refresh" (no other arguments), it would say
> "Nothing specified, nothing added.", and that is unrelated to the
> breakage reported and fixed in this thread, I think. It is the same
> message "git add" (no other arguments) gives, which I think is a
> mistake. "git add --refresh" is like "git add -u" in that the
> affected paths are determined by the index, and running these
> commands while your index is still empty can just be a silent no-op.
Something like this...
builtin/add.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index d7e3e44..84e8a3e 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -483,8 +483,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
(implicit_dot ? ADD_CACHE_IMPLICIT_DOT : 0);
if (require_pathspec && argc == 0) {
- fprintf(stderr, _("Nothing specified, nothing added.\n"));
- fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
+ if (!refresh_only) {
+ fprintf(stderr, _("Nothing specified, nothing added.\n"));
+ fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
+ }
return 0;
}
prev parent reply other threads:[~2013-12-26 19:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 8:06 git add -A fails in empty repository since 1.8.5 Thomas Ferris Nicolaisen
2013-12-18 8:44 ` Antoine Pelisse
2013-12-18 11:59 ` Duy Nguyen
2013-12-18 18:54 ` Junio C Hamano
2013-12-18 19:24 ` Matthieu Moy
2013-12-18 19:56 ` Junio C Hamano
2013-12-18 20:57 ` Junio C Hamano
2013-12-19 0:49 ` Duy Nguyen
2013-12-23 9:02 ` [PATCH] add: don't complain when adding empty project root Nguyễn Thái Ngọc Duy
2013-12-23 17:48 ` Torsten Bögershausen
2013-12-23 23:46 ` Duy Nguyen
2013-12-24 21:48 ` Torsten Bögershausen
2013-12-24 23:49 ` Duy Nguyen
2014-01-30 11:39 ` Torsten Bögershausen
2014-01-31 18:10 ` Junio C Hamano
2013-12-26 17:25 ` Jonathan Nieder
2013-12-26 18:54 ` Junio C Hamano
2013-12-26 19:24 ` Junio C Hamano [this message]
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=xmqqlhz7ct5b.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jrnieder@gmail$(echo .)com \
--cc=pclouds@gmail$(echo .)com \
--cc=tfnico@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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