diff mbox series

[RFC,v3,03/13] walken: add placeholder to initialize defaults

Message ID 20190701202014.34480-4-emilyshaffer@google.com (mailing list archive)
State New, archived
Headers show
Series example implementation of revwalk tutorial | expand

Commit Message

Emily Shaffer July 1, 2019, 8:20 p.m. UTC
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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/builtin/walken.c b/builtin/walken.c
index dd55f3b350..19657b5e31 100644
--- a/builtin/walken.c
+++ b/builtin/walken.c
@@ -8,6 +8,19 @@ 
 #include "parse-options.h"
 
 
+/*
+ * 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)
 {
 	/*
@@ -29,6 +42,8 @@  int cmd_walken(int argc, const char **argv, const char *prefix)
 	 */
 	argc = parse_options(argc, argv, prefix, options, walken_usage, 0);
 
+	init_walken_defaults();
+
 	/*
 	 * This line is "human-readable" and we are writing a plumbing command,
 	 * so we localize it and use the trace library to print only when