git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add warning for depth=0 in git clone.
@ 2013-01-08  8:07 Stefan Beller
  2013-01-08  8:09 ` Stefan Beller
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Stefan Beller @ 2013-01-08  8:07 UTC (permalink / raw)
  To: Junio C Hamano, Duy Nguyen, Jonathan Nieder, schlotter,
	Ralf.Wildenhues, git
  Cc: Stefan Beller

---
 builtin/clone.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/builtin/clone.c b/builtin/clone.c
index ec2f75b..5e91c1e 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -818,6 +818,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	remote = remote_get(option_origin);
 	transport = transport_get(remote, remote->url[0]);
 
+	if (option_depth && transport->smart_options->depth < 1)
+		die(_("--depth less or equal 0 makes no sense; read manpage."));
+
 	if (!is_local) {
 		if (!transport->get_refs_list || !transport->fetch)
 			die(_("Don't know how to clone %s"), transport->url);
-- 
1.8.1.166.g27cbb96

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-01-11  9:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08  8:07 [PATCH] add warning for depth=0 in git clone Stefan Beller
2013-01-08  8:09 ` Stefan Beller
2013-01-08  8:14   ` Jonathan Nieder
2013-01-08  8:12 ` Jonathan Nieder
2013-01-09  0:57 ` Duy Nguyen
2013-01-09  2:53   ` On --depth=funny value Junio C Hamano
2013-01-09  4:18     ` Duy Nguyen
2013-01-09  5:19       ` Junio C Hamano
2013-01-09 14:12         ` Duy Nguyen
2013-01-09 14:59     ` Duy Nguyen
2013-01-09 21:38     ` Stefan Beller
2013-01-11  3:30     ` [PATCH 1/2] fetch, upload-pack: add --no-shallow for infinite depth Nguyễn Thái Ngọc Duy
2013-01-11  3:30       ` [PATCH 2/2] upload-pack: fix off-by-one depth calculation in shallow clone Nguyễn Thái Ngọc Duy
2013-01-11  4:26         ` Junio C Hamano
2013-01-11  3:55       ` [PATCH 1/2] fetch, upload-pack: add --no-shallow for infinite depth Junio C Hamano
2013-01-11  9:05       ` [PATCH v2 1/3] fetch: add --unshallow for turning shallow repo into complete one Nguyễn Thái Ngọc Duy
2013-01-11  9:05         ` [PATCH v2 2/3] upload-pack: fix off-by-one depth calculation in shallow clone Nguyễn Thái Ngọc Duy
2013-01-11  9:05         ` [PATCH v2 3/3] fetch: elaborate --depth action Nguyễn Thái Ngọc Duy

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).