{"thread":{"id":"16714","subject":"[PATCH] Let git remote accept up as alias to update","startedAt":"2008-12-13T18:18:56Z","lastAt":"2008-12-14T11:25:01Z","messageCount":2,"participants":["Alexey Zaytsev","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"97802","messageId":"20081213181704.20126.4200.stgit@zaytsev.su","threadId":"16714","inReplyTo":null,"subject":"[PATCH] Let git remote accept up as alias to update","fromName":"Alexey Zaytsev","fromEmail":"alexey.zaytsev@gmail.com","sentAt":"2008-12-13T18:18:56Z","receivedAt":"2008-12-13T18:18:56Z","isPatch":true,"sender":{"key":"alexey.zaytsev@gmail.com","avatar":"https://gravatar.com/avatar/111ff2626bafc25e0477f25f915a4ea4651fe1c29d9512f631092800e4426acd?d=mp&s=160"},"body":"Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>\n---\n\nDon't know why, but I keep typing remote up instead of\nremote update. As update is probably by far the most\nused remote action, can we please have this alias?\n\n builtin-remote.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex abc8dd8..8f5cd6d 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -893,7 +893,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)\n \t\tresult = show(argc, argv);\n \telse if (!strcmp(argv[0], \"prune\"))\n \t\tresult = prune(argc, argv);\n-\telse if (!strcmp(argv[0], \"update\"))\n+\telse if (!strcmp(argv[0], \"update\") || !strcmp(argv[0], \"up\"))\n \t\tresult = update(argc, argv);\n \telse {\n \t\terror(\"Unknown subcommand: %s\", argv[0]);\n"},{"id":"97867","messageId":"20081214112501.GD6499@coredump.intra.peff.net","threadId":"16714","inReplyTo":"20081213181704.20126.4200.stgit@zaytsev.su","subject":"Re: [PATCH] Let git remote accept up as alias to update","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-14T11:25:01Z","receivedAt":"2008-12-14T11:25:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 13, 2008 at 09:18:56PM +0300, Alexey Zaytsev wrote:\n\n> Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>\n> ---\n> \n> Don't know why, but I keep typing remote up instead of\n> remote update. As update is probably by far the most\n> used remote action, can we please have this alias?\n\nHmm. The usual answer for requests like this is \"make your own alias\".\nBut usually they are for primary command aliases (e.g., \"co\" for\n\"checkout\"), and this is a sub-command. So you are actually stuck doing:\n\n  git config alias.rup \"remote update\"\n\nwhich is maybe better (even less typing) but is not exactly what you\nasked for.\n\nI think even nicer than an explicit \"up\" alias would be to accept any\nprefix as long as it was unique. However, I think a scheme like that\nwould only make sense if it was used fairly universally, and the current\ncode is not amenable to doing it for regular commands (it doesn't\nactually have a complete list of commands -- it just tries to exec what\nyou tell it). However, it could be refactored to do so.\n\n-Peff\n"}]}