Re: [PATCH] add warning for depth=0 in git clone.
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 8, 2013, 08:12 UTC
- Message-ID
- <20130108081221.GA5722@elie.Belkin>
- In-Reply-To
- <1357632422-5686-1-git-send-email-stefanbeller@googlemail.com>
Stefan Beller wrote:
Show 8 quoted lines
> --- 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."));"Makes no sense" is a little harsh. Presumably it made sense to the user, or she wouldn't have passed that option. The relevant point is that git was not able to make sense of it.
How about something like
fatal: shallow clone must have positive depth
? The "see manpage" is always implied by die(), and I don't see any particular reason to point to a specific section here.
Hope that helps, Jonathan