Skip to content

Commit 22f5bc6

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 <[email protected]>
1 parent 77e27ca commit 22f5bc6

File tree

7 files changed

+49
-0
lines changed

7 files changed

+49
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
/git-unpack-file
174174
/git-unpack-objects
175175
/git-update-index
176+
/git-update-microsoft-git
176177
/git-update-ref
177178
/git-update-server-info
178179
/git-upload-archive

Diff for: Documentation/git-update-microsoft-git.txt

+24
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

Diff for: Documentation/lint-manpages.sh

+1
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

Diff for: Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ BUILTIN_OBJS += builtin/tag.o
13191319
BUILTIN_OBJS += builtin/unpack-file.o
13201320
BUILTIN_OBJS += builtin/unpack-objects.o
13211321
BUILTIN_OBJS += builtin/update-index.o
1322+
BUILTIN_OBJS += builtin/update-microsoft-git.o
13221323
BUILTIN_OBJS += builtin/update-ref.o
13231324
BUILTIN_OBJS += builtin/update-server-info.o
13241325
BUILTIN_OBJS += builtin/upload-archive.o

Diff for: builtin.h

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix);
245245
int cmd_unpack_file(int argc, const char **argv, const char *prefix);
246246
int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
247247
int cmd_update_index(int argc, const char **argv, const char *prefix);
248+
int cmd_update_microsoft_git(int argc, const char **argv, const char *prefix);
248249
int cmd_update_ref(int argc, const char **argv, const char *prefix);
249250
int cmd_update_server_info(int argc, const char **argv, const char *prefix);
250251
int cmd_upload_archive(int argc, const char **argv, const char *prefix);

Diff for: builtin/update-microsoft-git.c

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 builtin_update_microsoft_git_usage[] =
12+
N_("git update-microsoft-git");
13+
14+
int cmd_update_microsoft_git(int argc, const char **argv, const char *prefix)
15+
{
16+
if (argc == 2 && !strcmp(argv[1], "-h"))
17+
usage(builtin_update_microsoft_git_usage);
18+
19+
return platform_specific_upgrade();
20+
}

Diff for: git.c

+1
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ static struct cmd_struct commands[] = {
703703
{ "unpack-file", cmd_unpack_file, RUN_SETUP | NO_PARSEOPT },
704704
{ "unpack-objects", cmd_unpack_objects, RUN_SETUP | NO_PARSEOPT },
705705
{ "update-index", cmd_update_index, RUN_SETUP },
706+
{ "update-microsoft-git", cmd_update_microsoft_git },
706707
{ "update-ref", cmd_update_ref, RUN_SETUP },
707708
{ "update-server-info", cmd_update_server_info, RUN_SETUP },
708709
{ "upload-archive", cmd_upload_archive, NO_PARSEOPT },

0 commit comments

Comments
 (0)