Skip to content

Commit 66d5c8b

Browse files
committed
Revert "builtin/commit-graph.c: support '--input=none'"
This reverts commit d203885, to give it the chance to be reworked.
1 parent b8618d2 commit 66d5c8b

File tree

5 files changed

+7
-47
lines changed

5 files changed

+7
-47
lines changed

Documentation/git-commit-graph.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ COMMANDS
3939
--------
4040
'write'::
4141

42-
Write a commit-graph file based on the specified sources of input:
42+
Write a commit-graph file based on the commits found in packfiles.
4343
+
4444
With the `--input=stdin-packs` option, generate the new commit graph by
4545
walking objects only in the specified pack-indexes. (Cannot be combined
@@ -57,12 +57,6 @@ walking commits starting at all refs. (Cannot be combined with
5757
With the `--input=append` option, include all commits that are present
5858
in the existing commit-graph file.
5959
+
60-
With the `--input=none` option, behave as if `--input=append` were
61-
given, but do not walk other packs to find additional commits.
62-
+
63-
If none of the above options are given, then generate the new
64-
commit-graph by walking over all pack-indexes.
65-
+
6660
With the `--split[=<strategy>]` option, write the commit-graph as a
6761
chain of multiple commit-graph files stored in
6862
`<dir>/info/commit-graphs`. Commit-graph layers are merged based on the

builtin/commit-graph.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static char const * const builtin_commit_graph_usage[] = {
1111
N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"),
1212
N_("git commit-graph write [--object-dir <objdir>] "
1313
"[--split[=<strategy>]] "
14-
"[--input=<reachable|stdin-packs|stdin-commits|append|none>] "
14+
"[--input=<reachable|stdin-packs|stdin-commits|append>] "
1515
"[--[no-]progress] <split options>"),
1616
NULL
1717
};
@@ -24,7 +24,7 @@ static const char * const builtin_commit_graph_verify_usage[] = {
2424
static const char * const builtin_commit_graph_write_usage[] = {
2525
N_("git commit-graph write [--object-dir <objdir>] "
2626
"[--split[=<strategy>]] "
27-
"[--input=<reachable|stdin-packs|stdin-commits|append|none>] "
27+
"[--input=<reachable|stdin-packs|stdin-commits|append>] "
2828
"[--[no-]progress] <split options>"),
2929
NULL
3030
};
@@ -33,8 +33,7 @@ enum commit_graph_input {
3333
COMMIT_GRAPH_INPUT_REACHABLE = (1 << 1),
3434
COMMIT_GRAPH_INPUT_STDIN_PACKS = (1 << 2),
3535
COMMIT_GRAPH_INPUT_STDIN_COMMITS = (1 << 3),
36-
COMMIT_GRAPH_INPUT_APPEND = (1 << 4),
37-
COMMIT_GRAPH_INPUT_NONE = (1 << 5)
36+
COMMIT_GRAPH_INPUT_APPEND = (1 << 4)
3837
};
3938

4039
static struct opts_commit_graph {
@@ -84,8 +83,6 @@ static int option_parse_input(const struct option *opt, const char *arg,
8483
*to |= COMMIT_GRAPH_INPUT_STDIN_COMMITS;
8584
else if (!strcmp(arg, "append"))
8685
*to |= COMMIT_GRAPH_INPUT_APPEND;
87-
else if (!strcmp(arg, "none"))
88-
*to |= (COMMIT_GRAPH_INPUT_APPEND | COMMIT_GRAPH_INPUT_NONE);
8986
else
9087
die(_("unrecognized --input source, %s"), arg);
9188
return 0;
@@ -231,8 +228,6 @@ static int graph_write(int argc, const char **argv)
231228
opts.obj_dir = get_object_directory();
232229
if (opts.input & COMMIT_GRAPH_INPUT_APPEND)
233230
flags |= COMMIT_GRAPH_WRITE_APPEND;
234-
if (opts.input & COMMIT_GRAPH_INPUT_NONE)
235-
flags |= COMMIT_GRAPH_WRITE_NO_INPUT;
236231
if (opts.split)
237232
flags |= COMMIT_GRAPH_WRITE_SPLIT;
238233
if (opts.progress)

commit-graph.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,7 @@ struct write_commit_graph_context {
788788
unsigned append:1,
789789
report_progress:1,
790790
split:1,
791-
check_oids:1,
792-
no_input:1;
791+
check_oids:1;
793792

794793
const struct split_commit_graph_opts *split_opts;
795794
};
@@ -1782,7 +1781,6 @@ int write_commit_graph(struct object_directory *odb,
17821781
ctx->split = flags & COMMIT_GRAPH_WRITE_SPLIT ? 1 : 0;
17831782
ctx->check_oids = flags & COMMIT_GRAPH_WRITE_CHECK_OIDS ? 1 : 0;
17841783
ctx->split_opts = split_opts;
1785-
ctx->no_input = flags & COMMIT_GRAPH_WRITE_NO_INPUT ? 1 : 0;
17861784

17871785
if (ctx->split) {
17881786
struct commit_graph *g;
@@ -1841,7 +1839,7 @@ int write_commit_graph(struct object_directory *odb,
18411839
goto cleanup;
18421840
}
18431841

1844-
if (!ctx->no_input && !pack_indexes && !commit_hex)
1842+
if (!pack_indexes && !commit_hex)
18451843
fill_oids_from_all_packs(ctx);
18461844

18471845
close_reachable(ctx);

commit-graph.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ enum commit_graph_write_flags {
7979
COMMIT_GRAPH_WRITE_PROGRESS = (1 << 1),
8080
COMMIT_GRAPH_WRITE_SPLIT = (1 << 2),
8181
/* Make sure that each OID in the input is a valid commit OID. */
82-
COMMIT_GRAPH_WRITE_CHECK_OIDS = (1 << 3),
83-
COMMIT_GRAPH_WRITE_NO_INPUT = (1 << 4)
82+
COMMIT_GRAPH_WRITE_CHECK_OIDS = (1 << 3)
8483
};
8584

8685
enum commit_graph_split_flags {

t/t5324-split-commit-graph.sh

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -376,30 +376,4 @@ test_expect_success '--split=no-merge always writes an incremental' '
376376
test_line_count = 2 $graphdir/commit-graph-chain
377377
'
378378

379-
test_expect_success '--split=no-merge, --input=none writes nothing' '
380-
test_when_finished rm -rf a graphs.before graphs.after &&
381-
rm -rf $graphdir &&
382-
git reset --hard commits/2 &&
383-
git rev-list -1 HEAD~1 >a &&
384-
git commit-graph write --split=no-merge --input=stdin-commits <a &&
385-
ls $graphdir/graph-*.graph >graphs.before &&
386-
test_line_count = 1 $graphdir/commit-graph-chain &&
387-
git commit-graph write --split --input=none &&
388-
ls $graphdir/graph-*.graph >graphs.after &&
389-
test_cmp graphs.before graphs.after
390-
'
391-
392-
test_expect_success '--split=merge-all, --input=none merges the chain' '
393-
test_when_finished rm -rf a b &&
394-
rm -rf $graphdir &&
395-
git reset --hard commits/2 &&
396-
git rev-list -1 HEAD~1 >a &&
397-
git rev-list -1 HEAD >b &&
398-
git commit-graph write --split=no-merge --input=stdin-commits <a &&
399-
git commit-graph write --split=no-merge --input=stdin-commits <b &&
400-
test_line_count = 2 $graphdir/commit-graph-chain &&
401-
git commit-graph write --split=merge-all --input=none &&
402-
test_line_count = 1 $graphdir/commit-graph-chain
403-
'
404-
405379
test_done

0 commit comments

Comments
 (0)