-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
ae30d7b
commit 4ce58ee
Showing
8 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
git-commit-graph(1) | ||
=================== | ||
|
||
NAME | ||
---- | ||
git-commit-graph - Write and verify Git commit graph files | ||
|
||
GIT | ||
--- | ||
Part of the linkgit:git[1] suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters