backfill: add builtin boilerplate

In anticipation of implementing 'git backfill', populate the necessary files with the boilerplate of a new builtin. Mark the builtin as experimental at this time, allowing breaking changes in the near future, if necessary. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Feb 3, 2025 at 17:11 UTC a3f79e9abdbdb27308ac7e3d9e362bcc361cecdc
9 files changed +60
.gitignore
+1
@@ -19,6 +19,7 @@
19 /git-apply
20 /git-archimport
21 /git-archive
22 +/git-backfill
23 /git-bisect
24 /git-blame
25 /git-branch
Documentation/git-backfill.txt new
+25
@@ -0,0 +1,25 @@
1 +git-backfill(1)
2 +===============
3 +
4 +NAME
5 +----
6 +git-backfill - Download missing objects in a partial clone
7 +
8 +
9 +SYNOPSIS
10 +--------
11 +[synopsis]
12 +git backfill [<options>]
13 +
14 +DESCRIPTION
15 +-----------
16 +
17 +THIS COMMAND IS EXPERIMENTAL. ITS BEHAVIOR MAY CHANGE IN THE FUTURE.
18 +
19 +SEE ALSO
20 +--------
21 +linkgit:git-clone[1].
22 +
23 +GIT
24 +---
25 +Part of the linkgit:git[1] suite
Documentation/meson.build
+1
@@ -6,6 +6,7 @@ manpages = {
6 'git-apply.txt' : 1,
7 'git-archimport.txt' : 1,
8 'git-archive.txt' : 1,
9 + 'git-backfill.txt' : 1,
10 'git-bisect.txt' : 1,
11 'git-blame.txt' : 1,
12 'git-branch.txt' : 1,
Makefile
+1
@@ -1203,6 +1203,7 @@ BUILTIN_OBJS += builtin/am.o
1203 BUILTIN_OBJS += builtin/annotate.o
1204 BUILTIN_OBJS += builtin/apply.o
1205 BUILTIN_OBJS += builtin/archive.o
1206 +BUILTIN_OBJS += builtin/backfill.o
1207 BUILTIN_OBJS += builtin/bisect.o
1208 BUILTIN_OBJS += builtin/blame.o
1209 BUILTIN_OBJS += builtin/branch.o
builtin.h
+1
@@ -120,6 +120,7 @@ int cmd_am(int argc, const char **argv, const char *prefix, struct repository *r
120 int cmd_annotate(int argc, const char **argv, const char *prefix, struct repository *repo);
121 int cmd_apply(int argc, const char **argv, const char *prefix, struct repository *repo);
122 int cmd_archive(int argc, const char **argv, const char *prefix, struct repository *repo);
123 +int cmd_backfill(int argc, const char **argv, const char *prefix, struct repository *repo);
124 int cmd_bisect(int argc, const char **argv, const char *prefix, struct repository *repo);
125 int cmd_blame(int argc, const char **argv, const char *prefix, struct repository *repo);
126 int cmd_branch(int argc, const char **argv, const char *prefix, struct repository *repo);
builtin/backfill.c new
+28
@@ -0,0 +1,28 @@
1 +#include "builtin.h"
2 +#include "config.h"
3 +#include "parse-options.h"
4 +#include "repository.h"
5 +#include "object.h"
6 +
7 +static const char * const builtin_backfill_usage[] = {
8 + N_("git backfill [<options>]"),
9 + NULL
10 +};
11 +
12 +int cmd_backfill(int argc, const char **argv, const char *prefix, struct repository *repo)
13 +{
14 + struct option options[] = {
15 + OPT_END(),
16 + };
17 +
18 + show_usage_if_asked(argc, argv, builtin_backfill_usage[0]);
19 +
20 + argc = parse_options(argc, argv, prefix, options, builtin_backfill_usage,
21 + 0);
22 +
23 + repo_config(repo, git_default_config, NULL);
24 +
25 + die(_("not implemented"));
26 +
27 + return 0;
28 +}
command-list.txt
+1
@@ -60,6 +60,7 @@ git-annotate ancillaryinterrogators
60 git-apply plumbingmanipulators complete
61 git-archimport foreignscminterface
62 git-archive mainporcelain
63 +git-backfill mainporcelain history
64 git-bisect mainporcelain info
65 git-blame ancillaryinterrogators complete
66 git-branch mainporcelain history
git.c
+1
@@ -506,6 +506,7 @@ static struct cmd_struct commands[] = {
506 { "annotate", cmd_annotate, RUN_SETUP },
507 { "apply", cmd_apply, RUN_SETUP_GENTLY },
508 { "archive", cmd_archive, RUN_SETUP_GENTLY },
509 + { "backfill", cmd_backfill, RUN_SETUP },
510 { "bisect", cmd_bisect, RUN_SETUP },
511 { "blame", cmd_blame, RUN_SETUP },
512 { "branch", cmd_branch, RUN_SETUP | DELAY_PAGER_CONFIG },
meson.build
+1
@@ -509,6 +509,7 @@ builtin_sources = [
509 'builtin/annotate.c',
510 'builtin/apply.c',
511 'builtin/archive.c',
512 + 'builtin/backfill.c',
513 'builtin/bisect.c',
514 'builtin/blame.c',
515 'builtin/branch.c',