From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: doron.behar@gmail.com, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 2/2] init-db: change --template type to OPTION_FILENAME
Date: Wed, 14 Feb 2018 17:51:49 +0700 [thread overview]
Message-ID: <20180214105149.28896-2-pclouds@gmail.com> (raw)
In-Reply-To: <20180214105149.28896-1-pclouds@gmail.com>
OPTION_FILENAME has some magic behind the scene, like prefixing which is
useless for init-db. The $HOME expansion though does come handy and
makes --template more consistent with the rest (both env and config var
get $HOME expansion).
Noticed-by: Doron Behar <doron.behar@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
builtin/init-db.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 68ff4ad75a..d6bd9f19cb 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -473,8 +473,9 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
const char *template_dir = NULL;
unsigned int flags = 0;
const struct option init_db_options[] = {
- OPT_STRING(0, "template", &template_dir, N_("template-directory"),
- N_("directory from which templates will be used")),
+ { OPTION_FILENAME, 0, "template", &template_dir,
+ N_("template-directory"),
+ N_("directory from which templates will be used")},
OPT_SET_INT(0, "bare", &is_bare_repository_cfg,
N_("create a bare repository"), 1),
{ OPTION_CALLBACK, 0, "shared", &init_shared_repository,
--
2.16.1.435.g8f24da2e1a
next prev parent reply other threads:[~2018-02-14 10:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 10:10 [BUG] git init doesn't respect `--template` like configuration variable init.templateDir and $GIT_TEMPLATE_DIR Doron Behar
2018-02-14 10:51 ` [PATCH 1/2] parse-options: expand $HOME on filename options Nguyễn Thái Ngọc Duy
2018-02-14 10:51 ` Nguyễn Thái Ngọc Duy [this message]
2018-02-14 14:08 ` [PATCH 2/2] init-db: change --template type to OPTION_FILENAME Jeff King
2018-02-14 14:05 ` [PATCH 1/2] parse-options: expand $HOME on filename options Jeff King
2018-02-14 18:24 ` Junio C Hamano
2018-02-14 22:46 ` Ævar Arnfjörð Bjarmason
2018-02-15 18:36 ` Junio C Hamano
2018-02-22 9:26 ` Duy Nguyen
2018-02-22 13:38 ` Ævar Arnfjörð Bjarmason
2018-02-23 10:11 ` Duy Nguyen
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=20180214105149.28896-2-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=doron.behar@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.