]> git.ipfire.org Git - thirdparty/git.git/commitdiff
backfill: add builtin boilerplate
authorDerrick Stolee <derrickstolee@github.com>
Mon, 3 Feb 2025 17:11:03 +0000 (17:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Feb 2025 00:12:41 +0000 (16:12 -0800)
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>
.gitignore
Documentation/git-backfill.txt [new file with mode: 0644]
Documentation/meson.build
Makefile
builtin.h
builtin/backfill.c [new file with mode: 0644]
command-list.txt
git.c
meson.build

index e82aa19df03fc865eaa0468f12b734cec0c48a2c..95cd94c504460cfb1b1a45a500db2672f32d855b 100644 (file)
@@ -19,6 +19,7 @@
 /git-apply
 /git-archimport
 /git-archive
+/git-backfill
 /git-bisect
 /git-blame
 /git-branch
diff --git a/Documentation/git-backfill.txt b/Documentation/git-backfill.txt
new file mode 100644 (file)
index 0000000..ab384da
--- /dev/null
@@ -0,0 +1,25 @@
+git-backfill(1)
+===============
+
+NAME
+----
+git-backfill - Download missing objects in a partial clone
+
+
+SYNOPSIS
+--------
+[synopsis]
+git backfill [<options>]
+
+DESCRIPTION
+-----------
+
+THIS COMMAND IS EXPERIMENTAL. ITS BEHAVIOR MAY CHANGE IN THE FUTURE.
+
+SEE ALSO
+--------
+linkgit:git-clone[1].
+
+GIT
+---
+Part of the linkgit:git[1] suite
index 2a26fa8a5fedc0f46a82fcc31bf1d6457f6d082c..5e9e3e19c5c126c6587078731f1717da71165776 100644 (file)
@@ -6,6 +6,7 @@ manpages = {
   'git-apply.txt' : 1,
   'git-archimport.txt' : 1,
   'git-archive.txt' : 1,
+  'git-backfill.txt' : 1,
   'git-bisect.txt' : 1,
   'git-blame.txt' : 1,
   'git-branch.txt' : 1,
index 0739c5c1c019144a794110c1503e8ee8dde31ce5..762fdaf0d74b12bb6373495a57681bd0346bdac9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1203,6 +1203,7 @@ BUILTIN_OBJS += builtin/am.o
 BUILTIN_OBJS += builtin/annotate.o
 BUILTIN_OBJS += builtin/apply.o
 BUILTIN_OBJS += builtin/archive.o
+BUILTIN_OBJS += builtin/backfill.o
 BUILTIN_OBJS += builtin/bisect.o
 BUILTIN_OBJS += builtin/blame.o
 BUILTIN_OBJS += builtin/branch.o
index f7b166b33484d312923473040c2ccac110865d51..89928ccf92f5324e94221157b89ce19cba66eff3 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -120,6 +120,7 @@ int cmd_am(int argc, const char **argv, const char *prefix, struct repository *r
 int cmd_annotate(int argc, const char **argv, const char *prefix, struct repository *repo);
 int cmd_apply(int argc, const char **argv, const char *prefix, struct repository *repo);
 int cmd_archive(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_backfill(int argc, const char **argv, const char *prefix, struct repository *repo);
 int cmd_bisect(int argc, const char **argv, const char *prefix, struct repository *repo);
 int cmd_blame(int argc, const char **argv, const char *prefix, struct repository *repo);
 int cmd_branch(int argc, const char **argv, const char *prefix, struct repository *repo);
diff --git a/builtin/backfill.c b/builtin/backfill.c
new file mode 100644 (file)
index 0000000..58d0866
--- /dev/null
@@ -0,0 +1,28 @@
+#include "builtin.h"
+#include "config.h"
+#include "parse-options.h"
+#include "repository.h"
+#include "object.h"
+
+static const char * const builtin_backfill_usage[] = {
+       N_("git backfill [<options>]"),
+       NULL
+};
+
+int cmd_backfill(int argc, const char **argv, const char *prefix, struct repository *repo)
+{
+       struct option options[] = {
+               OPT_END(),
+       };
+
+       show_usage_if_asked(argc, argv, builtin_backfill_usage[0]);
+
+       argc = parse_options(argc, argv, prefix, options, builtin_backfill_usage,
+                            0);
+
+       repo_config(repo, git_default_config, NULL);
+
+       die(_("not implemented"));
+
+       return 0;
+}
index e0bb87b3b5c278cd39a340a6d3291eb2ce6d3212..c537114b4687b8f98e4c2678b1f7a782e38fa984 100644 (file)
@@ -60,6 +60,7 @@ git-annotate                            ancillaryinterrogators
 git-apply                               plumbingmanipulators            complete
 git-archimport                          foreignscminterface
 git-archive                             mainporcelain
+git-backfill                            mainporcelain           history
 git-bisect                              mainporcelain           info
 git-blame                               ancillaryinterrogators          complete
 git-branch                              mainporcelain           history
diff --git a/git.c b/git.c
index b23761480f2f749b46767b9fc572e5ff7e188267..450d6aaa863de4a0ed6bd51366ef262cf51c88fc 100644 (file)
--- a/git.c
+++ b/git.c
@@ -506,6 +506,7 @@ static struct cmd_struct commands[] = {
        { "annotate", cmd_annotate, RUN_SETUP },
        { "apply", cmd_apply, RUN_SETUP_GENTLY },
        { "archive", cmd_archive, RUN_SETUP_GENTLY },
+       { "backfill", cmd_backfill, RUN_SETUP },
        { "bisect", cmd_bisect, RUN_SETUP },
        { "blame", cmd_blame, RUN_SETUP },
        { "branch", cmd_branch, RUN_SETUP | DELAY_PAGER_CONFIG },
index d54184befcf646f4f768dfcd80afd910a70010f4..2d2c88a22585b28464f3243143350527064158aa 100644 (file)
@@ -509,6 +509,7 @@ builtin_sources = [
   'builtin/annotate.c',
   'builtin/apply.c',
   'builtin/archive.c',
+  'builtin/backfill.c',
   'builtin/bisect.c',
   'builtin/blame.c',
   'builtin/branch.c',