diff --git a/.gitignore b/.gitignore index 590ed70176abbe..ef13253555459b 100644 --- a/.gitignore +++ b/.gitignore @@ -173,6 +173,7 @@ /git-unpack-file /git-unpack-objects /git-update-index +/git-update-microsoft-git /git-update-ref /git-update-server-info /git-upload-archive diff --git a/Documentation/git-update-microsoft-git.txt b/Documentation/git-update-microsoft-git.txt new file mode 100644 index 00000000000000..724bfc172f8ab7 --- /dev/null +++ b/Documentation/git-update-microsoft-git.txt @@ -0,0 +1,24 @@ +git-update-microsoft-git(1) +=========================== + +NAME +---- +git-update-microsoft-git - Update the installed version of Git + + +SYNOPSIS +-------- +[verse] +'git update-microsoft-git' + +DESCRIPTION +----------- +This version of Git is based on the Microsoft fork of Git, which +has custom capabilities focused on supporting monorepos. This +command checks for the latest release of that fork and installs +it on your machine. + + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Documentation/lint-manpages.sh b/Documentation/lint-manpages.sh index 8bc316ba7646e3..2622a493566950 100755 --- a/Documentation/lint-manpages.sh +++ b/Documentation/lint-manpages.sh @@ -28,6 +28,7 @@ check_missing_docs () ( git-remote-*) continue;; git-stage) continue;; git-gvfs-helper) continue;; + git-update-microsoft-git) continue;; git-legacy-*) continue;; git-?*--?* ) continue ;; esac diff --git a/Makefile b/Makefile index b4cabd43eae276..a1186e324b8e33 100644 --- a/Makefile +++ b/Makefile @@ -1319,6 +1319,7 @@ BUILTIN_OBJS += builtin/tag.o BUILTIN_OBJS += builtin/unpack-file.o BUILTIN_OBJS += builtin/unpack-objects.o BUILTIN_OBJS += builtin/update-index.o +BUILTIN_OBJS += builtin/update-microsoft-git.o BUILTIN_OBJS += builtin/update-ref.o BUILTIN_OBJS += builtin/update-server-info.o BUILTIN_OBJS += builtin/upload-archive.o diff --git a/builtin.h b/builtin.h index 8ab1623b32679c..6792775b20fdb0 100644 --- a/builtin.h +++ b/builtin.h @@ -245,6 +245,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix); int cmd_unpack_file(int argc, const char **argv, const char *prefix); int cmd_unpack_objects(int argc, const char **argv, const char *prefix); int cmd_update_index(int argc, const char **argv, const char *prefix); +int cmd_update_microsoft_git(int argc, const char **argv, const char *prefix); int cmd_update_ref(int argc, const char **argv, const char *prefix); int cmd_update_server_info(int argc, const char **argv, const char *prefix); int cmd_upload_archive(int argc, const char **argv, const char *prefix); diff --git a/builtin/update-microsoft-git.c b/builtin/update-microsoft-git.c new file mode 100644 index 00000000000000..329f6d77c0d1c9 --- /dev/null +++ b/builtin/update-microsoft-git.c @@ -0,0 +1,20 @@ +#include "builtin.h" +#include "repository.h" +#include "parse-options.h" +#include "run-command.h" + +static int platform_specific_upgrade(void) +{ + return 1; +} + +static const char builtin_update_microsoft_git_usage[] = + N_("git update-microsoft-git"); + +int cmd_update_microsoft_git(int argc, const char **argv, const char *prefix) +{ + if (argc == 2 && !strcmp(argv[1], "-h")) + usage(builtin_update_microsoft_git_usage); + + return platform_specific_upgrade(); +} diff --git a/git.c b/git.c index a7bce975d2310b..b656bee3a534b6 100644 --- a/git.c +++ b/git.c @@ -703,6 +703,7 @@ static struct cmd_struct commands[] = { { "unpack-file", cmd_unpack_file, RUN_SETUP | NO_PARSEOPT }, { "unpack-objects", cmd_unpack_objects, RUN_SETUP | NO_PARSEOPT }, { "update-index", cmd_update_index, RUN_SETUP }, + { "update-microsoft-git", cmd_update_microsoft_git }, { "update-ref", cmd_update_ref, RUN_SETUP }, { "update-server-info", cmd_update_server_info, RUN_SETUP }, { "upload-archive", cmd_upload_archive, NO_PARSEOPT },