summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f578825)
raw | patch | inline | side by side (parent: f578825)
author | Jeffrey C. Ollie <jeff@ocjtech.us> | |
Thu, 7 Jun 2007 12:50:29 +0000 (07:50 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 28 Jun 2007 05:22:17 +0000 (22:22 -0700) |
git-init lacks an option to suppress non-error and non-warning output -
this patch adds one.
Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
this patch adds one.
Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-init-db.txt | patch | blob | history | |
Documentation/git-init.txt | patch | blob | history | |
builtin-init-db.c | patch | blob | history |
index ab0201aec2131d48b535cf6307fc446dffd89a9b..d4e01cb325150b72a30bde67ba55461d8062fb83 100644 (file)
SYNOPSIS
--------
-'git-init-db' [--template=<template_directory>] [--shared[=<permissions>]]
+'git-init-db' [-q | --quiet] [--template=<template_directory>] [--shared[=<permissions>]]
DESCRIPTION
index 413ed65143d90b32a9b77301953f45bc26465e7d..07484a4fd065b639bbf33832cbf642eb8399757e 100644 (file)
SYNOPSIS
--------
-'git-init' [--template=<template_directory>] [--shared[=<permissions>]]
+'git-init' [-q | --quiet] [--template=<template_directory>] [--shared[=<permissions>]]
OPTIONS
--
+-q, \--quiet::
+
+Only print error and warning messages, all other output will be suppressed.
+
--template=<template_directory>::
Provide the directory from which templates will be used. The default template
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 976f47b3233cf0aba34e104bb4524aace40dccba..d429ceda369ed4810ee42ae9aea6da105b795cc7 100644 (file)
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
}
static const char init_db_usage[] =
-"git-init [--template=<template-directory>] [--shared]";
+"git-init [-q | --quiet] [--template=<template-directory>] [--shared]";
/*
* If you want to, you can share the DB area with any number of branches.
const char *template_dir = NULL;
char *path;
int len, i, reinit;
+ int quiet = 0;
for (i = 1; i < argc; i++, argv++) {
const char *arg = argv[1];
shared_repository = PERM_GROUP;
else if (!prefixcmp(arg, "--shared="))
shared_repository = git_config_perm("arg", arg+9);
+ else if (!strcmp(arg, "-q") || !strcmp(arg, "--quiet"))
+ quiet = 1;
else
usage(init_db_usage);
}
git_config_set("receive.denyNonFastforwards", "true");
}
- printf("%s%s Git repository in %s/\n",
- reinit ? "Reinitialized existing" : "Initialized empty",
- shared_repository ? " shared" : "",
- git_dir);
+ if (!quiet)
+ printf("%s%s Git repository in %s/\n",
+ reinit ? "Reinitialized existing" : "Initialized empty",
+ shared_repository ? " shared" : "",
+ git_dir);
return 0;
}