Skip to content

Commit 35d9c4d

Browse files
derrickstoleedscho
authored andcommitted
update-microsoft-git: create barebones builtin
Just do the boilerplate stuff of making a new builtin, including documentation and integration with git.c. Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
1 parent 46f15e2 commit 35d9c4d

File tree

10 files changed

+59
-0
lines changed

10 files changed

+59
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
/git-unpack-file
180180
/git-unpack-objects
181181
/git-update-index
182+
/git-update-microsoft-git
182183
/git-update-ref
183184
/git-update-server-info
184185
/git-upload-archive
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
git-update-microsoft-git(1)
2+
===========================
3+
4+
NAME
5+
----
6+
git-update-microsoft-git - Update the installed version of Git
7+
8+
9+
SYNOPSIS
10+
--------
11+
[verse]
12+
'git update-microsoft-git'
13+
14+
DESCRIPTION
15+
-----------
16+
This version of Git is based on the Microsoft fork of Git, which
17+
has custom capabilities focused on supporting monorepos. This
18+
command checks for the latest release of that fork and installs
19+
it on your machine.
20+
21+
22+
GIT
23+
---
24+
Part of the linkgit:git[1] suite

Documentation/lint-manpages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ check_missing_docs () (
2828
git-remote-*) continue;;
2929
git-stage) continue;;
3030
git-gvfs-helper) continue;;
31+
git-update-microsoft-git) continue;;
3132
git-legacy-*) continue;;
3233
git-?*--?* ) continue ;;
3334
esac

Documentation/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ manpages = {
151151
'git-unpack-file.adoc' : 1,
152152
'git-unpack-objects.adoc' : 1,
153153
'git-update-index.adoc' : 1,
154+
'git-update-microsoft-git.adoc' : 1,
154155
'git-update-ref.adoc' : 1,
155156
'git-update-server-info.adoc' : 1,
156157
'git-upload-archive.adoc' : 1,

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ BUILTIN_OBJS += builtin/tag.o
14861486
BUILTIN_OBJS += builtin/unpack-file.o
14871487
BUILTIN_OBJS += builtin/unpack-objects.o
14881488
BUILTIN_OBJS += builtin/update-index.o
1489+
BUILTIN_OBJS += builtin/update-microsoft-git.o
14891490
BUILTIN_OBJS += builtin/update-ref.o
14901491
BUILTIN_OBJS += builtin/update-server-info.o
14911492
BUILTIN_OBJS += builtin/upload-archive.o

builtin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix, struct repository *
242242
int cmd_unpack_file(int argc, const char **argv, const char *prefix, struct repository *repo);
243243
int cmd_unpack_objects(int argc, const char **argv, const char *prefix, struct repository *repo);
244244
int cmd_update_index(int argc, const char **argv, const char *prefix, struct repository *repo);
245+
int cmd_update_microsoft_git(int argc, const char **argv, const char *prefix, struct repository *repo);
245246
int cmd_update_ref(int argc, const char **argv, const char *prefix, struct repository *repo);
246247
int cmd_update_server_info(int argc, const char **argv, const char *prefix, struct repository *repo);
247248
int cmd_upload_archive(int argc, const char **argv, const char *prefix, struct repository *repo);

builtin/update-microsoft-git.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "builtin.h"
2+
#include "repository.h"
3+
#include "parse-options.h"
4+
#include "run-command.h"
5+
6+
static int platform_specific_upgrade(void)
7+
{
8+
return 1;
9+
}
10+
11+
static const char * const update_microsoft_git_usage[] = {
12+
N_("git update-microsoft-git"),
13+
NULL,
14+
};
15+
16+
17+
int cmd_update_microsoft_git(int argc, const char **argv, const char *prefix UNUSED, struct repository *repo UNUSED)
18+
{
19+
static struct option microsoft_git_options[] = {
20+
OPT_END(),
21+
};
22+
show_usage_with_options_if_asked(argc, argv,
23+
update_microsoft_git_usage,
24+
microsoft_git_options);
25+
26+
return platform_specific_upgrade();
27+
}

git.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ static struct cmd_struct commands[] = {
739739
{ "unpack-file", cmd_unpack_file, RUN_SETUP | NO_PARSEOPT },
740740
{ "unpack-objects", cmd_unpack_objects, RUN_SETUP | NO_PARSEOPT },
741741
{ "update-index", cmd_update_index, RUN_SETUP },
742+
{ "update-microsoft-git", cmd_update_microsoft_git },
742743
{ "update-ref", cmd_update_ref, RUN_SETUP },
743744
{ "update-server-info", cmd_update_server_info, RUN_SETUP },
744745
{ "upload-archive", cmd_upload_archive, NO_PARSEOPT },

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ builtin_sources = [
679679
'builtin/unpack-file.c',
680680
'builtin/unpack-objects.c',
681681
'builtin/update-index.c',
682+
'builtin/update-microsoft-git.c',
682683
'builtin/update-ref.c',
683684
'builtin/update-server-info.c',
684685
'builtin/upload-archive.c',

t/t1517-outside-repo.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ do
121121
mktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \
122122
remote-http | remote-https | replay | send-email | \
123123
sh-i18n--envsubst | shell | show | stage | submodule | survey | svn | \
124+
update-microsoft-git | \
124125
upload-archive--writer | upload-pack | web--browse | whatchanged)
125126
expect_outcome=expect_failure ;;
126127
*)

0 commit comments

Comments
 (0)