{"thread":{"id":"6795","subject":"linux-2.6.git/packed-refs???","startedAt":"2007-02-13T09:27:03Z","lastAt":"2007-02-13T18:41:24Z","messageCount":9,"participants":["Junio C Hamano","Johannes Schindelin","Jeff King","Theodore Tso"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34385","messageId":"7v7ium1k7s.fsf@assigned-by-dhcp.cox.net","threadId":"6795","inReplyTo":null,"subject":"linux-2.6.git/packed-refs???","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T09:27:03Z","receivedAt":"2007-02-13T09:27:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I noticed while scanning #git log that it appears that pack-refs\nwas run in your public repo and some people cannot clone over\ndumb protocols with older git.\n\n    commit 2986c02217f98809d8990e7679edf0f5d99f904d\n    Author: Junio C Hamano <junkio@cox.net>\n    Date:   Wed Nov 22 22:24:09 2006 -0800\n\n    git-fetch: fix dumb protocol transport to fetch from pack-pruned ref\n\nwas the first revision that aligned dumb protocol clients with\npack-ref; unfortunately anything older will not find the ref\nthat was packed.\n\nWe do have a backward compatibility warning on this in v1.5.0\nrelease notes draft, but I think we would make it more obvious.\n\nSigh...\n"},{"id":"34387","messageId":"7vzm7iz8uv.fsf@assigned-by-dhcp.cox.net","threadId":"6795","inReplyTo":"7v7ium1k7s.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Do not run git-pack-refs by default for now from git-gc","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T09:48:24Z","receivedAt":"2007-02-13T09:48:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Just to be on the safe side, let's not run pack-refs from git-gc\nwithout an explicit \"[gc] packrefs = true\" configuration.  This\ndefault should be changed in the future when we can reasonably\nassume that everybody runs post v1.5.0-rc0 version of git, at\nwhich time people can still ask it not to run with the same\nconfiguration (\"[gc] packrefs = false\").\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 0129b1f..36b2c4f 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -321,6 +321,16 @@ format.headers::\n \tAdditional email headers to include in a patch to be submitted\n \tby mail.  See gitlink:git-format-patch[1].\n \n+gc.packrefs::\n+\t`git gc` does not run `git pack-refs` by default\n+\tso that older dumb-transport clients can still fetch\n+\tfrom the repository.  Setting this to `true` lets `git\n+\tgc` to run `git pack-refs`.  Enable it only when you\n+\tknow you do not have to support such clients.  The\n+\tdefault will change to run `git pack-refs` in some\n+\tfuture, and setting this to `false` will continue to\n+\tprevent `git pack-refs` from being run from `git gc`.\n+\n gc.reflogexpire::\n \t`git reflog expire` removes reflog entries older than\n \tthis time; defaults to 90 days.\ndiff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt\nindex e37758a..ca38c2e 100644\n--- a/Documentation/git-gc.txt\n+++ b/Documentation/git-gc.txt\n@@ -62,9 +62,14 @@ The optional configuration variable 'gc.rerereunresolved' indicates\n how long records of conflicted merge you have not resolved are\n kept.  This defaults to 15 days.\n \n+The optional configuration variable 'gc.packrefs' determines if\n+`git gc` runs `git-pack-refs`.  Without the configuration, `git-pack-refs` \n+is not run by default to allow older dumb-transport clients\n+fetch from the repository,  but this will change in the future.\n \n See Also\n --------\n+gitlink:git-pack-refs[1]\n gitlink:git-prune[1]\n gitlink:git-reflog[1]\n gitlink:git-repack[1]\ndiff --git a/git-gc.sh b/git-gc.sh\nindex 3e8c87c..054f338 100755\n--- a/git-gc.sh\n+++ b/git-gc.sh\n@@ -22,7 +22,11 @@ do\n \tshift\n done\n \n-git-pack-refs --prune &&\n+if pack_refs=$(git config --bool --get gc.packrefs) &&\n+   test \"true\" = \"$pack_refs\"\n+then\n+\tgit-pack-refs --prune\n+fi &&\n git-reflog expire --all &&\n git-repack -a -d -l &&\n $no_prune git-prune &&\n"},{"id":"34388","messageId":"Pine.LNX.4.63.0702131101400.1300@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6795","inReplyTo":"7vzm7iz8uv.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Do not run git-pack-refs by default for now from git-gc","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-13T10:03:32Z","receivedAt":"2007-02-13T10:03:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Feb 2007, Junio C Hamano wrote:\n\n> Just to be on the safe side, let's not run pack-refs from git-gc\n> without an explicit \"[gc] packrefs = true\" configuration.\n\nIt seems to me that the reason are dumb transports, which are very likely \nto run only from bare repositories. How about checking for a bare \nrepository explicitely, and only if it _is_ bare, check for gc.packrefs, \ntoo?\n\nPacked refs _do_ have a tremendous advantage (when you have a lot of tags, \nlike many CVS switchers).\n\nCiao,\nDscho\n"},{"id":"34392","messageId":"20070213102951.GA14903@coredump.intra.peff.net","threadId":"6795","inReplyTo":"Pine.LNX.4.63.0702131101400.1300@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Do not run git-pack-refs by default for now from git-gc","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-02-13T10:29:51Z","receivedAt":"2007-02-13T10:29:51Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 13, 2007 at 11:03:32AM +0100, Johannes Schindelin wrote:\n\n> It seems to me that the reason are dumb transports, which are very likely \n> to run only from bare repositories. How about checking for a bare \n> repository explicitely, and only if it _is_ bare, check for gc.packrefs, \n> too?\n\nThe way you have stated it, I think we will get a lot of \"I set\ngc.packrefs, but it doesn't do anything!\" complaints. I think a\ntri-state \"yes/no/notbare\" defaulting to \"notbare\" makes more sense. But\nmaybe you meant the other way around in the first place.\n\n-Peff\n"},{"id":"34395","messageId":"Pine.LNX.4.63.0702131151520.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6795","inReplyTo":"20070213102951.GA14903@coredump.intra.peff.net","subject":"Re: [PATCH] Do not run git-pack-refs by default for now from git-gc","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-13T10:55:43Z","receivedAt":"2007-02-13T10:55:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Feb 2007, Jeff King wrote:\n\n> On Tue, Feb 13, 2007 at 11:03:32AM +0100, Johannes Schindelin wrote:\n> \n> > It seems to me that the reason are dumb transports, which are very \n> > likely to run only from bare repositories. How about checking for a \n> > bare repository explicitely, and only if it _is_ bare, check for \n> > gc.packrefs, too?\n> \n> The way you have stated it, I think we will get a lot of \"I set \n> gc.packrefs, but it doesn't do anything!\" complaints. I think a \n> tri-state \"yes/no/notbare\" defaulting to \"notbare\" makes more sense. But \n> maybe you meant the other way around in the first place.\n\nNo, I meant it as you understood it. But your solution is evidently way \nmore elegant.\n\nCiao,\nDscho\n"},{"id":"34402","messageId":"Pine.LNX.4.63.0702131400280.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6795","inReplyTo":"20070213102951.GA14903@coredump.intra.peff.net","subject":"[PATCH] git-gc: run pack-refs by default unless the repo is bare","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-13T13:01:42Z","receivedAt":"2007-02-13T13:01:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe config variable gc.packrefs is tristate now: \"true\", \"false\"\nand \"notbare\", where \"notbare\" is the default.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tOn Tue, 13 Feb 2007, Jeff King wrote:\n\t\n\t> I think a tri-state \"yes/no/notbare\" defaulting to \"notbare\" \n\t> makes more sense.\n\n\tThis is on top of Junio's patch.\n\n Documentation/config.txt |   13 +++++++------\n Documentation/git-gc.txt |    4 ++--\n git-gc.sh                |   14 +++++++++-----\n 3 files changed, 18 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 36b2c4f..3865535 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -322,13 +322,14 @@ format.headers::\n \tby mail.  See gitlink:git-format-patch[1].\n \n gc.packrefs::\n-\t`git gc` does not run `git pack-refs` by default\n-\tso that older dumb-transport clients can still fetch\n+\t`git gc` does not run `git pack-refs` in a bare repository by\n+\tdefault so that older dumb-transport clients can still fetch\n \tfrom the repository.  Setting this to `true` lets `git\n-\tgc` to run `git pack-refs`.  Enable it only when you\n-\tknow you do not have to support such clients.  The\n-\tdefault will change to run `git pack-refs` in some\n-\tfuture, and setting this to `false` will continue to\n+\tgc` to run `git pack-refs`.  Setting this to `false` tells\n+\t`git gc` never to run `git pack-refs`. The default setting is\n+\t`notbare`. Enable it only when you know you do not have to\n+\tsupport such clients.  The default setting will change to `true`\n+\tat some stage, and setting this to `false` will continue to\n \tprevent `git pack-refs` from being run from `git gc`.\n \n gc.reflogexpire::\ndiff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt\nindex ca38c2e..910f12a 100644\n--- a/Documentation/git-gc.txt\n+++ b/Documentation/git-gc.txt\n@@ -64,8 +64,8 @@ kept.  This defaults to 15 days.\n \n The optional configuration variable 'gc.packrefs' determines if\n `git gc` runs `git-pack-refs`.  Without the configuration, `git-pack-refs` \n-is not run by default to allow older dumb-transport clients\n-fetch from the repository,  but this will change in the future.\n+is not run in bare repositories by default, to allow older dumb-transport\n+clients fetch from the repository,  but this will change in the future.\n \n See Also\n --------\ndiff --git a/git-gc.sh b/git-gc.sh\nindex 054f338..1a45de5 100755\n--- a/git-gc.sh\n+++ b/git-gc.sh\n@@ -22,11 +22,15 @@ do\n \tshift\n done\n \n-if pack_refs=$(git config --bool --get gc.packrefs) &&\n-   test \"true\" = \"$pack_refs\"\n-then\n-\tgit-pack-refs --prune\n-fi &&\n+case \"$(git config --get gc.packrefs)\" in\n+notbare|\"\")\n+\ttest $(is_bare_repository) = true || pack_refs=true;;\n+*)\n+\tpack_refs=$(git config --bool --get gc.packrefs)\n+esac\n+\n+test \"true\" != \"$pack_refs\" ||\n+git-pack-refs --prune &&\n git-reflog expire --all &&\n git-repack -a -d -l &&\n $no_prune git-prune &&\n-- \n1.5.0.rc4.2434.g472e7\n"},{"id":"34440","messageId":"7vbqjyx7kr.fsf@assigned-by-dhcp.cox.net","threadId":"6795","inReplyTo":"Pine.LNX.4.63.0702131151520.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Do not run git-pack-refs by default for now from git-gc","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T17:59:00Z","receivedAt":"2007-02-13T17:59:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks both.\n"},{"id":"34452","messageId":"20070213181610.GA2782@thunk.org","threadId":"6795","inReplyTo":"7v7ium1k7s.fsf@assigned-by-dhcp.cox.net","subject":"Re: linux-2.6.git/packed-refs???","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-02-13T18:16:10Z","receivedAt":"2007-02-13T18:16:10Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Tue, Feb 13, 2007 at 01:27:03AM -0800, Junio C Hamano wrote:\n> I noticed while scanning #git log that it appears that pack-refs\n> was run in your public repo and some people cannot clone over\n> dumb protocols with older git.\n> \n>     commit 2986c02217f98809d8990e7679edf0f5d99f904d\n>     Author: Junio C Hamano <junkio@cox.net>\n>     Date:   Wed Nov 22 22:24:09 2006 -0800\n> \n>     git-fetch: fix dumb protocol transport to fetch from pack-pruned ref\n> \n> was the first revision that aligned dumb protocol clients with\n> pack-ref; unfortunately anything older will not find the ref\n> that was packed.\n\nStupid question.  Suppose someone has run git pack-refs on a\nrepository.  What is the recommended way to reverse the process.  Is\nthe answer is to clone the repository and then throw away the original\none?  Is there another way to do it?\n\n\t\t\t\t\t\t- Ted\n"},{"id":"34460","messageId":"Pine.LNX.4.63.0702131937240.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6795","inReplyTo":"20070213181610.GA2782@thunk.org","subject":"Re: linux-2.6.git/packed-refs???","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-13T18:41:24Z","receivedAt":"2007-02-13T18:41:24Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Feb 2007, Theodore Tso wrote:\n\n> On Tue, Feb 13, 2007 at 01:27:03AM -0800, Junio C Hamano wrote:\n> > I noticed while scanning #git log that it appears that pack-refs\n> > was run in your public repo and some people cannot clone over\n> > dumb protocols with older git.\n> > \n> >     commit 2986c02217f98809d8990e7679edf0f5d99f904d\n> >     Author: Junio C Hamano <junkio@cox.net>\n> >     Date:   Wed Nov 22 22:24:09 2006 -0800\n> > \n> >     git-fetch: fix dumb protocol transport to fetch from pack-pruned ref\n> > \n> > was the first revision that aligned dumb protocol clients with\n> > pack-ref; unfortunately anything older will not find the ref\n> > that was packed.\n> \n> Stupid question.  Suppose someone has run git pack-refs on a\n> repository.  What is the recommended way to reverse the process.  Is\n> the answer is to clone the repository and then throw away the original\n> one?  Is there another way to do it?\n\nThe easiest way I found here was to do\n\ngit-for-each-ref | while read sha1 tag name; do\n\tgit update-ref -m \"undo pack-ref\" $name $sha1\ndone\n\nBeware: this is tested once, and copied from memory.\n\nCiao,\nDscho\n"}]}