From: Luciano Rocha <luciano@eurotux.com>
To: git@vger.kernel.org
Subject: [PATCH] git-init: inform user of `git --bare init' option
Date: Tue, 20 May 2008 20:48:50 +0100 [thread overview]
Message-ID: <20080520194850.GB19226@bit.office.eurotux.com> (raw)
In-Reply-To: <20080519175313.GA17305@bit.office.eurotux.com>
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 ...
Document the second option, and show an error informing of it if the
user calls `git-init' with a `--bare' option.
Signed-off-by: Luciano Rocha <strange@nsk.pt>
---
Documentation/git-init.txt | 2 ++
builtin-init-db.c | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index b17ae84..bb87e58 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -84,6 +84,8 @@ Running `git-init` in an existing repository is safe. It will not overwrite
things that are already there. The primary reason for rerunning `git-init`
is to pick up newly added templates.
+For creating a bare repository, use the form `git --bare init`.
+
Note that `git-init` is the same as `git-init-db`. The command
was primarily meant to initialize the object database, but over
time it has become responsible for setting up the other aspects
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"))
--
1.5.5.1.317.ge7bcb.dirty
next prev parent reply other threads:[~2008-05-20 19:49 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 ` Luciano Rocha [this message]
2008-05-23 6:02 ` [PATCH] git-init: inform user of `git --bare init' option Junio C Hamano
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=20080520194850.GB19226@bit.office.eurotux.com \
--to=luciano@eurotux.com \
--cc=git@vger.kernel.org \
/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).