[PATCH] git-init: inform user of `git --bare init' option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux