{"thread":{"id":"5854","subject":"[RFC/PATCH] pack-refs --all","startedAt":"2006-10-08T08:08:54Z","lastAt":"2006-10-08T19:56:18Z","messageCount":5,"participants":["Junio C Hamano","Jakub Narebski","Petr Baudis","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"28408","messageId":"7v4pufkz55.fsf@assigned-by-dhcp.cox.net","threadId":"5854","inReplyTo":null,"subject":"[RFC/PATCH] pack-refs --all","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-08T08:08:54Z","receivedAt":"2006-10-08T08:08:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This changes 'git-pack-refs' to pack only tags by default.\nBranches are meant to be updated, either by committing onto it\nyourself or tracking remote branches, and packed entries can\nbecome stale easily, but tags are usually \"create once and live\nforever\" and benefit more from packing.\n\n---\n\n * Likes?  Dislikes?\n\n builtin-pack-refs.c |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-pack-refs.c b/builtin-pack-refs.c\nindex 23d0d07..1087657 100644\n--- a/builtin-pack-refs.c\n+++ b/builtin-pack-refs.c\n@@ -2,7 +2,7 @@ #include \"cache.h\"\n #include \"refs.h\"\n \n static const char builtin_pack_refs_usage[] =\n-\"git-pack-refs [--prune]\";\n+\"git-pack-refs [--all] [--prune]\";\n \n struct ref_to_prune {\n \tstruct ref_to_prune *next;\n@@ -68,6 +68,7 @@ int cmd_pack_refs(int argc, const char *\n {\n \tint fd, i;\n \tstruct pack_refs_cb_data cbdata;\n+\tint (*iterate_ref)(each_ref_fn, void *) = for_each_tag_ref;\n \n \tmemset(&cbdata, 0, sizeof(cbdata));\n \n@@ -77,6 +78,10 @@ int cmd_pack_refs(int argc, const char *\n \t\t\tcbdata.prune = 1;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(arg, \"--all\")) {\n+\t\t\titerate_ref = for_each_ref;\n+\t\t\tcontinue;\n+\t\t}\n \t\t/* perhaps other parameters later... */\n \t\tbreak;\n \t}\n@@ -88,7 +93,7 @@ int cmd_pack_refs(int argc, const char *\n \tif (!cbdata.refs_file)\n \t\tdie(\"unable to create ref-pack file structure (%s)\",\n \t\t    strerror(errno));\n-\tfor_each_ref(handle_one_ref, &cbdata);\n+\titerate_ref(handle_one_ref, &cbdata);\n \tfflush(cbdata.refs_file);\n \tfsync(fd);\n \tfclose(cbdata.refs_file);\n"},{"id":"28413","messageId":"egaicb$bb$2@sea.gmane.org","threadId":"5854","inReplyTo":"7v4pufkz55.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC/PATCH] pack-refs --all","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-08T10:03:45Z","receivedAt":"2006-10-08T10:03:45Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n>  * Likes?  Dislikes?\n\n+1\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28414","messageId":"20061008101403.GJ20017@pasky.or.cz","threadId":"5854","inReplyTo":"7v4pufkz55.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC/PATCH] pack-refs --all","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-08T10:14:03Z","receivedAt":"2006-10-08T10:14:03Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Oct 08, 2006 at 10:08:54AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> This changes 'git-pack-refs' to pack only tags by default.\n> Branches are meant to be updated, either by committing onto it\n> yourself or tracking remote branches, and packed entries can\n> become stale easily, but tags are usually \"create once and live\n> forever\" and benefit more from packing.\n> \n> ---\n> \n>  * Likes?  Dislikes?\n\nLooks much saner, thanks. :-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"},{"id":"28417","messageId":"Pine.LNX.4.63.0610081401000.14200@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5854","inReplyTo":"7v4pufkz55.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC/PATCH] pack-refs --all","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-10-08T12:02:34Z","receivedAt":"2006-10-08T12:02:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 8 Oct 2006, Junio C Hamano wrote:\n\n> This changes 'git-pack-refs' to pack only tags by default.\n\nSince there is not really a high cost attached, why not migrate towards \nonly-packed-refs? (Of course, this means that git-update-ref should learn \nto update in-place)?\n\nCiao,\nDscho\n"},{"id":"28429","messageId":"7vlknqintp.fsf@assigned-by-dhcp.cox.net","threadId":"5854","inReplyTo":"Pine.LNX.4.63.0610081401000.14200@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [RFC/PATCH] pack-refs --all","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-08T19:56:18Z","receivedAt":"2006-10-08T19:56:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Sun, 8 Oct 2006, Junio C Hamano wrote:\n>\n>> This changes 'git-pack-refs' to pack only tags by default.\n>\n> Since there is not really a high cost attached, why not migrate towards \n> only-packed-refs? (Of course, this means that git-update-ref should learn \n> to update in-place)?\n\nIt indeed is tempting and I was tempted to do that and unify\nthat with ref-log when we were talking about packed refs before\nI saw Linus's initial implementation.\n"}]}