Skip to content

Commit ce757fa

Browse files
committed
backfill: add builtin boilerplate
In anticipation of implementing 'git backfill', populate the necessary files with the boilerplate of a new builtin. RFC TODO: When preparing this for a full implementation, make sure it is based on the newest standards introduced by [1]. [1] https://lore.kernel.org/git/[email protected]/T/#m606036ea2e75a6d6819d6b5c90e729643b0ff7f7 [PATCH 1/3] builtin: add a repository parameter for builtin functions Signed-off-by: Derrick Stolee <[email protected]>
1 parent d9fc474 commit ce757fa

File tree

7 files changed

+57
-0
lines changed

7 files changed

+57
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/git-apply
2020
/git-archimport
2121
/git-archive
22+
/git-backfill
2223
/git-bisect
2324
/git-blame
2425
/git-branch

Documentation/git-backfill.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
[verse]
12+
'git backfill' [<options>]
13+
14+
DESCRIPTION
15+
-----------
16+
17+
SEE ALSO
18+
--------
19+
linkgit:git-clone[1].
20+
21+
GIT
22+
---
23+
Part of the linkgit:git[1] suite

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,7 @@ BUILTIN_OBJS += builtin/am.o
12071207
BUILTIN_OBJS += builtin/annotate.o
12081208
BUILTIN_OBJS += builtin/apply.o
12091209
BUILTIN_OBJS += builtin/archive.o
1210+
BUILTIN_OBJS += builtin/backfill.o
12101211
BUILTIN_OBJS += builtin/bisect.o
12111212
BUILTIN_OBJS += builtin/blame.o
12121213
BUILTIN_OBJS += builtin/branch.o

builtin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ int cmd_am(int argc, const char **argv, const char *prefix);
127127
int cmd_annotate(int argc, const char **argv, const char *prefix);
128128
int cmd_apply(int argc, const char **argv, const char *prefix);
129129
int cmd_archive(int argc, const char **argv, const char *prefix);
130+
int cmd_backfill(int argc, const char **argv, const char *prefix);
130131
int cmd_bisect(int argc, const char **argv, const char *prefix);
131132
int cmd_blame(int argc, const char **argv, const char *prefix);
132133
int cmd_branch(int argc, const char **argv, const char *prefix);

builtin/backfill.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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)
13+
{
14+
struct option options[] = {
15+
OPT_END(),
16+
};
17+
18+
if (argc == 2 && !strcmp(argv[1], "-h"))
19+
usage_with_options(builtin_backfill_usage, options);
20+
21+
argc = parse_options(argc, argv, prefix, options, builtin_backfill_usage,
22+
0);
23+
24+
git_config(git_default_config, NULL);
25+
26+
die(_("not implemented"));
27+
28+
return 0;
29+
}

command-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ git-annotate ancillaryinterrogators
6060
git-apply plumbingmanipulators complete
6161
git-archimport foreignscminterface
6262
git-archive mainporcelain
63+
git-backfill mainporcelain history
6364
git-bisect mainporcelain info
6465
git-blame ancillaryinterrogators complete
6566
git-branch mainporcelain history

git.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ static struct cmd_struct commands[] = {
502502
{ "annotate", cmd_annotate, RUN_SETUP },
503503
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
504504
{ "archive", cmd_archive, RUN_SETUP_GENTLY },
505+
{ "backfill", cmd_backfill, RUN_SETUP },
505506
{ "bisect", cmd_bisect, RUN_SETUP },
506507
{ "blame", cmd_blame, RUN_SETUP },
507508
{ "branch", cmd_branch, RUN_SETUP | DELAY_PAGER_CONFIG },

0 commit comments

Comments
 (0)