{"thread":{"id":"10654","subject":"[PATCH] Build in ls-remote","startedAt":"2007-11-04T20:51:17Z","lastAt":"2007-11-05T21:22:21Z","messageCount":2,"participants":["Daniel Barkalow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58305","messageId":"Pine.LNX.4.64.0711041544200.7357@iabervon.org","threadId":"10654","inReplyTo":null,"subject":"[PATCH] Build in ls-remote","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-04T20:51:17Z","receivedAt":"2007-11-04T20:51:17Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"This actually replaces peek-remote with ls-remote, since peek-remote\nnow handles everything. peek-remote remains an a second name for\nls-remote, although its help message now gives the \"ls-remote\" name.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nKeeping scripts in .../examples makes the diffstat much less compelling. \nThis actually replaces a 142-line shell script with one line in git.c. I'm \nnot actually sure if this one is even worth keeping as an example, since \nthe git-specific portions just delegated to C code anyway.\n\n Makefile                                           |    3 +--\n builtin-peek-remote.c => builtin-ls-remote.c       |   10 +++++-----\n builtin.h                                          |    2 +-\n .../examples/git-ls-remote.sh                      |    0 \n git.c                                              |    3 ++-\n 5 files changed, 9 insertions(+), 9 deletions(-)\n rename builtin-peek-remote.c => builtin-ls-remote.c (83%)\n rename git-ls-remote.sh => contrib/examples/git-ls-remote.sh (100%)\n\ndiff --git a/Makefile b/Makefile\nindex 3ec1876..470e54a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -210,7 +210,6 @@ BASIC_LDFLAGS =\n SCRIPT_SH = \\\n \tgit-bisect.sh git-checkout.sh \\\n \tgit-clean.sh git-clone.sh git-commit.sh \\\n-\tgit-ls-remote.sh \\\n \tgit-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \\\n \tgit-pull.sh git-rebase.sh git-rebase--interactive.sh \\\n \tgit-repack.sh git-request-pull.sh \\\n@@ -345,6 +344,7 @@ BUILTIN_OBJS = \\\n \tbuiltin-log.o \\\n \tbuiltin-ls-files.o \\\n \tbuiltin-ls-tree.o \\\n+\tbuiltin-ls-remote.o \\\n \tbuiltin-mailinfo.o \\\n \tbuiltin-mailsplit.o \\\n \tbuiltin-merge-base.o \\\n@@ -352,7 +352,6 @@ BUILTIN_OBJS = \\\n \tbuiltin-mv.o \\\n \tbuiltin-name-rev.o \\\n \tbuiltin-pack-objects.o \\\n-\tbuiltin-peek-remote.o \\\n \tbuiltin-prune.o \\\n \tbuiltin-prune-packed.o \\\n \tbuiltin-push.o \\\ndiff --git a/builtin-peek-remote.c b/builtin-ls-remote.c\nsimilarity index 83%\nrename from builtin-peek-remote.c\nrename to builtin-ls-remote.c\nindex b4106f5..003580c 100644\n--- a/builtin-peek-remote.c\n+++ b/builtin-ls-remote.c\n@@ -3,10 +3,10 @@\n #include \"transport.h\"\n #include \"remote.h\"\n \n-static const char peek_remote_usage[] =\n-\"git-peek-remote [--upload-pack=<git-upload-pack>] [<host>:]<directory>\";\n+static const char ls_remote_usage[] =\n+\"git-ls-remote [--upload-pack=<git-upload-pack>] [<host>:]<directory>\";\n \n-int cmd_peek_remote(int argc, const char **argv, const char *prefix)\n+int cmd_ls_remote(int argc, const char **argv, const char *prefix)\n {\n \tint i;\n \tconst char *dest = NULL;\n@@ -43,14 +43,14 @@ int cmd_peek_remote(int argc, const char **argv, const char *prefix)\n \t\t\t\tflags |= REF_NORMAL;\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tusage(peek_remote_usage);\n+\t\t\tusage(ls_remote_usage);\n \t\t}\n \t\tdest = arg;\n \t\tbreak;\n \t}\n \n \tif (!dest || i != argc - 1)\n-\t\tusage(peek_remote_usage);\n+\t\tusage(ls_remote_usage);\n \n \ttransport = transport_get(NULL, dest);\n \tif (uploadpack != NULL)\ndiff --git a/builtin.h b/builtin.h\nindex 2335c01..525107f 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -48,6 +48,7 @@ extern int cmd_log(int argc, const char **argv, const char *prefix);\n extern int cmd_log_reflog(int argc, const char **argv, const char *prefix);\n extern int cmd_ls_files(int argc, const char **argv, const char *prefix);\n extern int cmd_ls_tree(int argc, const char **argv, const char *prefix);\n+extern int cmd_ls_remote(int argc, const char **argv, const char *prefix);\n extern int cmd_mailinfo(int argc, const char **argv, const char *prefix);\n extern int cmd_mailsplit(int argc, const char **argv, const char *prefix);\n extern int cmd_merge_base(int argc, const char **argv, const char *prefix);\n@@ -55,7 +56,6 @@ extern int cmd_merge_file(int argc, const char **argv, const char *prefix);\n extern int cmd_mv(int argc, const char **argv, const char *prefix);\n extern int cmd_name_rev(int argc, const char **argv, const char *prefix);\n extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);\n-extern int cmd_peek_remote(int argc, const char **argv, const char *prefix);\n extern int cmd_pickaxe(int argc, const char **argv, const char *prefix);\n extern int cmd_prune(int argc, const char **argv, const char *prefix);\n extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);\ndiff --git a/git-ls-remote.sh b/contrib/examples/git-ls-remote.sh\nsimilarity index 100%\nrename from git-ls-remote.sh\nrename to contrib/examples/git-ls-remote.sh\ndiff --git a/git.c b/git.c\nindex 19a2172..b173f22 100644\n--- a/git.c\n+++ b/git.c\n@@ -326,6 +326,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"log\", cmd_log, RUN_SETUP | USE_PAGER },\n \t\t{ \"ls-files\", cmd_ls_files, RUN_SETUP },\n \t\t{ \"ls-tree\", cmd_ls_tree, RUN_SETUP },\n+\t\t{ \"ls-remote\", cmd_ls_remote },\n \t\t{ \"mailinfo\", cmd_mailinfo },\n \t\t{ \"mailsplit\", cmd_mailsplit },\n \t\t{ \"merge-base\", cmd_merge_base, RUN_SETUP },\n@@ -333,7 +334,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"mv\", cmd_mv, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"name-rev\", cmd_name_rev, RUN_SETUP },\n \t\t{ \"pack-objects\", cmd_pack_objects, RUN_SETUP },\n-\t\t{ \"peek-remote\", cmd_peek_remote },\n+\t\t{ \"peek-remote\", cmd_ls_remote },\n \t\t{ \"pickaxe\", cmd_blame, RUN_SETUP },\n \t\t{ \"prune\", cmd_prune, RUN_SETUP },\n \t\t{ \"prune-packed\", cmd_prune_packed, RUN_SETUP },\n-- \n1.5.3.4.1206.g5f96\n"},{"id":"58418","messageId":"7vy7dco0aa.fsf@gitster.siamese.dyndns.org","threadId":"10654","inReplyTo":"Pine.LNX.4.64.0711041544200.7357@iabervon.org","subject":"Re: [PATCH] Build in ls-remote","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-05T21:22:21Z","receivedAt":"2007-11-05T21:22:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> This actually replaces peek-remote with ls-remote, since peek-remote\n> now handles everything.\n\nNice logical conclusion of the series ;-)\nWill queue.\n\nThanks.\n"}]}