-
Notifications
You must be signed in to change notification settings - Fork 140
Commit-graph write refactor (was: Create commit-graph file format v2) #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0be7713
95f66e8
b4e3ae5
a5223a3
b5b8a87
98e243b
fe36c8a
b8dfb66
40acc6e
b403c01
7ecf923
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,8 @@ static int graph_write(int argc, const char **argv) | |
struct string_list *pack_indexes = NULL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, SZEDER Gábor wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
|
||
struct string_list *commit_hex = NULL; | ||
struct string_list lines; | ||
int result = 0; | ||
unsigned int flags = COMMIT_GRAPH_PROGRESS; | ||
|
||
static struct option builtin_commit_graph_write_options[] = { | ||
OPT_STRING(0, "object-dir", &opts.obj_dir, | ||
|
@@ -165,13 +167,13 @@ static int graph_write(int argc, const char **argv) | |
die(_("use at most one of --reachable, --stdin-commits, or --stdin-packs")); | ||
if (!opts.obj_dir) | ||
opts.obj_dir = get_object_directory(); | ||
if (opts.append) | ||
flags |= COMMIT_GRAPH_APPEND; | ||
|
||
read_replace_refs = 0; | ||
|
||
if (opts.reachable) { | ||
write_commit_graph_reachable(opts.obj_dir, opts.append, 1); | ||
return 0; | ||
} | ||
if (opts.reachable) | ||
return write_commit_graph_reachable(opts.obj_dir, flags); | ||
|
||
string_list_init(&lines, 0); | ||
if (opts.stdin_packs || opts.stdin_commits) { | ||
|
@@ -188,14 +190,14 @@ static int graph_write(int argc, const char **argv) | |
UNLEAK(buf); | ||
} | ||
|
||
write_commit_graph(opts.obj_dir, | ||
pack_indexes, | ||
commit_hex, | ||
opts.append, | ||
1); | ||
if (write_commit_graph(opts.obj_dir, | ||
pack_indexes, | ||
commit_hex, | ||
flags)) | ||
result = 1; | ||
|
||
UNLEAK(lines); | ||
return 0; | ||
return result; | ||
} | ||
|
||
int cmd_commit_graph(int argc, const char **argv, const char *prefix) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Derrick Stolee wrote (reply to this):