[RFC PATCH 03/13] walken: add placeholder to initialize defaults
- From
Emily Shaffer <emilyshaffer@google.com>
- Date
- Jun 7, 2019, 01:08 UTC
- Message-ID
- <20190607010811.52944-4-emilyshaffer@google.com>
- In-Reply-To
- <20190607010811.52944-1-emilyshaffer@google.com>
Eventually, we will want a good place to initialize default variables for use during our revision walk(s) in `git walken`. For now, there's nothing to do here, but let's add the scaffolding so that it's easy to tell where to put the setup later on.
Signed-off-by: Emily Shaffer <emilyshaffer@google.com> --- builtin/walken.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/builtin/walken.c b/builtin/walken.c index 5ae7c7d93f..dcee906556 100644 --- a/builtin/walken.c +++ b/builtin/walken.c @@ -13,6 +13,18 @@ static const char * const walken_usage[] = { NULL, }; +/* + * Within init_walken_defaults() we can call into other useful defaults to set + * in the global scope or on the_repository. It's okay to borrow from other + * functions which are doing something relatively similar to yours. + */ +static void init_walken_defaults(void) +{ + /* We don't actually need the same components `git log` does; leave this + * empty for now. + */ +} + int cmd_walken(int argc, const char **argv, const char *prefix) { struct option options[] = { @@ -21,6 +33,7 @@ int cmd_walken(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, options, walken_usage, 0); + init_walken_defaults(); printf(_("cmd_walken incoming...\n")); return 0; }
-- 2.22.0.rc1.311.g5d7573a151-goog