summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-04-02 20:34:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-02 21:27:38 (GMT)
commit4ce58ee38de3ab0955b94946bfc339f387227223 (patch)
tree85f5ad519188e8bfbd9fb383a6b980fbb0349c69 /builtin
parentae30d7b1151348068a24ac241cb4f6ad7f5e661b (diff)
downloadgit-4ce58ee38de3ab0955b94946bfc339f387227223.zip
git-4ce58ee38de3ab0955b94946bfc339f387227223.tar.gz
git-4ce58ee38de3ab0955b94946bfc339f387227223.tar.bz2
commit-graph: create git-commit-graph builtin
Teach git the 'commit-graph' builtin that will be used for writing and reading packed graph files. The current implementation is mostly empty, except for an '--object-dir' option. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit-graph.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
new file mode 100644
index 0000000..b466ecd
--- /dev/null
+++ b/builtin/commit-graph.c
@@ -0,0 +1,36 @@
+#include "builtin.h"
+#include "config.h"
+#include "parse-options.h"
+
+static char const * const builtin_commit_graph_usage[] = {
+ N_("git commit-graph [--object-dir <objdir>]"),
+ NULL
+};
+
+static struct opts_commit_graph {
+ const char *obj_dir;
+} opts;
+
+
+int cmd_commit_graph(int argc, const char **argv, const char *prefix)
+{
+ static struct option builtin_commit_graph_options[] = {
+ OPT_STRING(0, "object-dir", &opts.obj_dir,
+ N_("dir"),
+ N_("The object directory to store the graph")),
+ OPT_END(),
+ };
+
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage_with_options(builtin_commit_graph_usage,
+ builtin_commit_graph_options);
+
+ git_config(git_default_config, NULL);
+ argc = parse_options(argc, argv, prefix,
+ builtin_commit_graph_options,
+ builtin_commit_graph_usage,
+ PARSE_OPT_STOP_AT_NON_OPTION);
+
+ usage_with_options(builtin_commit_graph_usage,
+ builtin_commit_graph_options);
+}