{"thread":{"id":"2889","subject":"Make \"git-send-pack\" less verbose by default","startedAt":"2005-12-21T02:13:02Z","lastAt":"2005-12-21T02:13:02Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"13849","messageId":"Pine.LNX.4.64.0512201809210.4827@g5.osdl.org","threadId":"2889","inReplyTo":null,"subject":"Make \"git-send-pack\" less verbose by default","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-12-21T02:13:02Z","receivedAt":"2005-12-21T02:13:02Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nIt used to make sense to have git-send-pack talk about the things it sent \nwhen (a) it was a new program and (b) nobody had a lot of tags and \nbranches.\n\nThese days, it's just distracting to see tons of\n\n\t'refs/tags/xyz': up-to-date\n\t...\n\nwhen updating a remote repo.\n\nSo shut it up by default, and add a \"--verbose\" flag for those who really \nwant to see it.\n\nAlso, since this makes he case of everything being up-to-date just totally \nsilent, make it say \"Everything up-to-date\" if no refs needed updating.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\ndiff --git a/send-pack.c b/send-pack.c\nindex 6ce0d9f..a41bbe5 100644\n--- a/send-pack.c\n+++ b/send-pack.c\n@@ -8,6 +8,7 @@ static const char send_pack_usage[] =\n \"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\\n\"\n \"  --all and explicit <head> specification are mutually exclusive.\";\n static const char *exec = \"git-receive-pack\";\n+static int verbose = 0;\n static int send_all = 0;\n static int force_update = 0;\n \n@@ -206,7 +207,8 @@ static int send_pack(int in, int out, in\n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n \t\tif (!memcmp(ref->old_sha1, ref->peer_ref->new_sha1, 20)) {\n-\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n+\t\t\tif (verbose)\n+\t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n \t\t\tcontinue;\n \t\t}\n \n@@ -270,6 +272,8 @@ static int send_pack(int in, int out, in\n \tpacket_flush(out);\n \tif (new_refs)\n \t\tpack_objects(out, remote_refs);\n+\telse\n+\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n \tclose(out);\n \treturn ret;\n }\n@@ -301,6 +305,10 @@ int main(int argc, char **argv)\n \t\t\t\tforce_update = 1;\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (!strcmp(arg, \"--verbose\")) {\n+\t\t\t\tverbose = 1;\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tusage(send_pack_usage);\n \t\t}\n \t\tif (!dest) {\n"}]}