From: Junio C Hamano <junio@pobox.com>
To: Luciano Rocha <luciano@eurotux.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-init: inform user of `git --bare init' option
Date: Thu, 22 May 2008 23:02:59 -0700 [thread overview]
Message-ID: <7vy761sgks.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080520194850.GB19226@bit.office.eurotux.com> (Luciano Rocha's message of "Tue, 20 May 2008 20:48:50 +0100")
Luciano Rocha <luciano@eurotux.com> writes:
> Creation of a bare repository isn't consistent:
>
> $ git init --bare
> usage: git-init [-q | --quiet] [--template=<template-directory>] [--shared]
> $ git --bare init
> Initialized empty Git repository in ...
The examples do not demonstrate that "it isn't consistent". It just
demonstrates that it is easy for people to forget that --bare option is an
option to the "git" potty itself and not an option to "git init".
> diff --git a/builtin-init-db.c b/builtin-init-db.c
> index a76f5d3..65454b1 100644
> --- a/builtin-init-db.c
> +++ b/builtin-init-db.c
> @@ -334,6 +334,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
> template_dir = arg+11;
> else if (!strcmp(arg, "--shared"))
> shared_repository = PERM_GROUP;
> + else if (!strcmp(arg, "--bare"))
> + die("Run `git --bare init' instead to create a bare repository");
> else if (!prefixcmp(arg, "--shared="))
> shared_repository = git_config_perm("arg", arg+9);
> else if (!strcmp(arg, "-q") || !strcmp(arg, "--quiet"))
Given that you are adding a special case support for "git init --bare"
anyway, a better approach to help people out of this easy confusion (and
we have to admit that the confusion is very easy!) would be to make "git
init --bare" pretend/behave as if the user said "git --bare init", don't
you think?
next prev parent reply other threads:[~2008-05-23 6:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 17:53 bare --init Vs --init bare Luciano Rocha
2008-05-19 19:32 ` Santi Béjar
2008-05-19 20:10 ` Luciano Rocha
2008-05-20 19:48 ` [PATCH] git-init: inform user of `git --bare init' option Luciano Rocha
2008-05-23 6:02 ` Junio C Hamano [this message]
2008-05-23 14:24 ` Luciano Rocha
2008-05-28 18:51 ` [PATCH] git-init: treat option `--bare' Luciano Rocha
2008-05-28 18:53 ` Luciano Rocha
2008-05-29 0:55 ` Junio C Hamano
2008-05-29 9:10 ` Luciano Rocha
2008-05-29 13:51 ` Johannes Schindelin
2008-05-29 18:31 ` 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=7vy761sgks.fsf@gitster.siamese.dyndns.org \
--to=junio@pobox.com \
--cc=git@vger.kernel.org \
--cc=luciano@eurotux.com \
/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).