{"thread":{"id":"25544","subject":"Why /var/cache/git?","startedAt":"2010-10-25T10:30:06Z","lastAt":"2010-10-28T15:53:02Z","messageCount":9,"participants":["Bron Gondwana","J.H.","Drew Northup","Gerrit Pape","Jakub Narebski","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154395","messageId":"20101025103006.GA18782@brong.net","threadId":"25544","inReplyTo":null,"subject":"Why /var/cache/git?","fromName":"Bron Gondwana","fromEmail":"brong@fastmail.fm","sentAt":"2010-10-25T10:30:06Z","receivedAt":"2010-10-25T10:30:06Z","isPatch":false,"sender":{"key":"brong@fastmail.fm","avatar":"https://gravatar.com/avatar/9b7b59d9f9f104cf348df27c705c0ab5537bd40f291b0adf7885d5d1cea10d00?d=mp&s=160"},"body":"(resent - correct address for git list!)\n\n(Gerrit: you're CC'd as the attribution in README.Debian\n which in the one place I can see /var/cache/git mentioned\n in the docs - without a justification for why it was\n chosen...)\n\nI'm setting up shared repositories on a machine, and I notice\nall the examples I can find on the web, and also the \nauto-created directory from the packages are /var/cache/git/\n\nSo I looked at the FHS, because that seemed odd to me:\n\nhttp://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA\n\n    /var/cache is intended for cached data from applications.\n    Such data is locally generated as a result of time-consuming\n    I/O or calculation. The application must be able to regenerate\n    or restore the data. Unlike /var/spool, the cached files can\n    be deleted without data loss.\n\nI guess in theory, someone else has all those commits in their\nlocal git repository somewhere.  Still, it feels to me that\n/var/lib/git is the correct location.  Is there any reason why\n/var/spool/git was chosen?\n\n(I'm running Debian Lenny with the 1.7.1 backport packages, but\nI see examples from Fedora with the same paths as well)\n\nBron.\n"},{"id":"154417","messageId":"4CC5A13F.2090702@eaglescrag.net","threadId":"25544","inReplyTo":"20101025103006.GA18782@brong.net","subject":"Re: Why /var/cache/git?","fromName":"J.H.","fromEmail":"warthog19@eaglescrag.net","sentAt":"2010-10-25T15:24:47Z","receivedAt":"2010-10-25T15:24:47Z","isPatch":false,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"On 10/25/2010 03:30 AM, Bron Gondwana wrote:\n> (resent - correct address for git list!)\n> \n> (Gerrit: you're CC'd as the attribution in README.Debian\n>  which in the one place I can see /var/cache/git mentioned\n>  in the docs - without a justification for why it was\n>  chosen...)\n\nCouple of quick points:\n\n$ grep -Ri \"/var/git\\|\\/var\\/git\" *\nDocumentation/git-cvsserver.txt:     export\nCVSROOT=:ext:user@server:/var/git/project.git\n\ngitweb/README:    RewriteRule ^/var(/|/gitweb.cgi)?$\t\n/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]\n\ngitweb/README:Second, repositories found in /pub/scm/ and /var/git/ will\nbe accesible\n\nAre the only 3 instances where this is mentioned.  Looking at those\nquick it was probably chosen based on the fact that it's a location that\nlikely exists on most machines.  Or just for explanatory reasons like\n/example/dir/project.git could be used.\n\n> I'm setting up shared repositories on a machine, and I notice\n> all the examples I can find on the web, and also the \n> auto-created directory from the packages are /var/cache/git/\n\nI can't speak for the web, it's a place filled with many many evil dirty\nlies, but the primary documentation should likely get updated to not\nactually shove perminant data into a transient location.  Bonus that\ngitweb (caching) might use the directory for it's cache storage which\ncould cause some amusement.\n\n> \n> So I looked at the FHS, because that seemed odd to me:\n[...]\n> I guess in theory, someone else has all those commits in their\n> local git repository somewhere.  Still, it feels to me that\n> /var/lib/git is the correct location.  Is there any reason why\n> /var/spool/git was chosen?\n\nUmmmm are you talking about for where a set of repositories exist on a\nshared setup?  Personally, and depending on your beliefs as a sysadmin,\nit should likely end up under something like /home/git or some other\nshared location like /group/git, /pub/git, /shared/git or really\nanywhere where you are likely to do backups and not just run rm -rf\nbecause it should be a transient location.\n\n> (I'm running Debian Lenny with the 1.7.1 backport packages, but\n> I see examples from Fedora with the same paths as well)\n\nSpeaking from the Fedora angle (since I don't have a Debian box handy\nanywhere or in a VM) the only places I'm seeing /var/git mentioned is:\n\n/usr/share/doc/git-1.7.2.3/git-cvsserver.txt\n/usr/share/doc/git-1.7.2.3/git-cvsserver.html\n/usr/share/doc/git-cvs-1.7.2.3/git-cvsserver.txt\n/usr/share/doc/git-cvs-1.7.2.3/git-cvsserver.html\n/usr/share/doc/git-cvs-1.7.2.3/git-cvsserver.html\n/usr/share/doc/gitweb-1.7.2.3/README\n/usr/share/doc/gitweb-caching-1.6.5.2/README\n\nwhich are the latest versions of all of those packages and it's obvious\nit's the git-cvs and gitweb stuff that are to blame for the confusion there.\n\nProbably easiest thing to do is adjust the documentation to be\n/example/dir/project.git vs. /var/git since I agree, that's actually\ndangerous.\n\n- John 'Warthog9' Hawley\n"},{"id":"154430","messageId":"20101026012224.GA3360@brong.net","threadId":"25544","inReplyTo":"4CC5A13F.2090702@eaglescrag.net","subject":"Re: Why /var/cache/git?","fromName":"Bron Gondwana","fromEmail":"brong@fastmail.fm","sentAt":"2010-10-26T01:22:24Z","receivedAt":"2010-10-26T01:22:24Z","isPatch":false,"sender":{"key":"brong@fastmail.fm","avatar":"https://gravatar.com/avatar/9b7b59d9f9f104cf348df27c705c0ab5537bd40f291b0adf7885d5d1cea10d00?d=mp&s=160"},"body":"On Mon, Oct 25, 2010 at 08:24:47AM -0700, J.H. wrote:\n> On 10/25/2010 03:30 AM, Bron Gondwana wrote:\n> > (resent - correct address for git list!)\n> > \n> > (Gerrit: you're CC'd as the attribution in README.Debian\n> >  which in the one place I can see /var/cache/git mentioned\n> >  in the docs - without a justification for why it was\n> >  chosen...)\n> \n> Couple of quick points:\n> \n> $ grep -Ri \"/var/git\\|\\/var\\/git\" *\n> Documentation/git-cvsserver.txt:     export\n> CVSROOT=:ext:user@server:/var/git/project.git\n> \n> gitweb/README:    RewriteRule ^/var(/|/gitweb.cgi)?$\t\n> /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]\n> \n> gitweb/README:Second, repositories found in /pub/scm/ and /var/git/ will\n> be accesible\n> \n> Are the only 3 instances where this is mentioned.  Looking at those\n> quick it was probably chosen based on the fact that it's a location that\n> likely exists on most machines.  Or just for explanatory reasons like\n> /example/dir/project.git could be used.\n\nI have no problem with /var/git - it's /var/cache/git that worries\nme, since the FHS quite clearly says that blowing away /var/cache/*\nis not a problem.  It makes sense to back up /var/lib/ on any machine,\nsince that's somewhere that contains application data.  We already\nback up a few things from /var/lib (like /var/lib/svn for example,\nat least until we finish this switchover!)\n \nBron.\n"},{"id":"154444","messageId":"1288099299.8291.6.camel@drew-northup.unet.maine.edu","threadId":"25544","inReplyTo":"20101026012224.GA3360@brong.net","subject":"Re: Why /var/cache/git?","fromName":"Drew Northup","fromEmail":"drew.northup@maine.edu","sentAt":"2010-10-26T13:21:39Z","receivedAt":"2010-10-26T13:21:39Z","isPatch":false,"sender":{"key":"drew.northup@maine.edu","avatar":"https://avatars.githubusercontent.com/u/18331571?v=4"},"body":"\nOn Tue, 2010-10-26 at 12:22 +1100, Bron Gondwana wrote:\n> On Mon, Oct 25, 2010 at 08:24:47AM -0700, J.H. wrote:\n> > On 10/25/2010 03:30 AM, Bron Gondwana wrote:\n> > > (resent - correct address for git list!)\n> > > \n> > > (Gerrit: you're CC'd as the attribution in README.Debian\n> > >  which in the one place I can see /var/cache/git mentioned\n> > >  in the docs - without a justification for why it was\n> > >  chosen...)\n> > \n> > Couple of quick points:\n> > \n> > $ grep -Ri \"/var/git\\|\\/var\\/git\" *\n> > Documentation/git-cvsserver.txt:     export\n> > CVSROOT=:ext:user@server:/var/git/project.git\n> > \n> > gitweb/README:    RewriteRule ^/var(/|/gitweb.cgi)?$\t\n> > /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]\n> > \n> > gitweb/README:Second, repositories found in /pub/scm/ and /var/git/ will\n> > be accesible\n> > \n> > Are the only 3 instances where this is mentioned.  Looking at those\n> > quick it was probably chosen based on the fact that it's a location that\n> > likely exists on most machines.  Or just for explanatory reasons like\n> > /example/dir/project.git could be used.\n> \n> I have no problem with /var/git - it's /var/cache/git that worries\n> me, since the FHS quite clearly says that blowing away /var/cache/*\n> is not a problem.  It makes sense to back up /var/lib/ on any machine,\n> since that's somewhere that contains application data.  We already\n> back up a few things from /var/lib (like /var/lib/svn for example,\n> at least until we finish this switchover!)\n\nBron,\nDoing a 'git grep \"/var\"' on the git sources and then searching that\noutput for \"cache\" turns up nothing. I think you'd best bring this up\nwith the Debian package maintainer. Debian is well known for thinking it\nknows better than the original authors where stuff should be--and that's\nwhy I don't run Debian as a server (too much time spent transliterating\npaths just to make stuff work properly--when I'm lucky; it makes an\nexcellent desktop for beginners).\n\n-- \n-Drew Northup N1XIM\n   AKA RvnPhnx on OPN\n________________________________________________\n\"As opposed to vegetable or mineral error?\"\n-John Pescatore, SANS NewsBites Vol. 12 Num. 59\n"},{"id":"154450","messageId":"20101026152218.3931.qmail@d862ae2b10e11a.315fe32.mid.smarden.org","threadId":"25544","inReplyTo":"1288099299.8291.6.camel@drew-northup.unet.maine.edu","subject":"Re: Why /var/cache/git?","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2010-10-26T15:22:18Z","receivedAt":"2010-10-26T15:22:18Z","isPatch":false,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Tue, Oct 26, 2010 at 09:21:39AM -0400, Drew Northup wrote:\n> On Tue, 2010-10-26 at 12:22 +1100, Bron Gondwana wrote:\n> > I have no problem with /var/git - it's /var/cache/git that worries\n> > me, since the FHS quite clearly says that blowing away /var/cache/*\n> > is not a problem.  It makes sense to back up /var/lib/ on any machine,\n> > since that's somewhere that contains application data.  We already\n> > back up a few things from /var/lib (like /var/lib/svn for example,\n> > at least until we finish this switchover!)\n> \n> Bron,\n> Doing a 'git grep \"/var\"' on the git sources and then searching that\n> output for \"cache\" turns up nothing. I think you'd best bring this up\n> with the Debian package maintainer. Debian is well known for thinking it\n> knows better than the original authors where stuff should be--and that's\n> why I don't run Debian as a server (too much time spent transliterating\n> paths just to make stuff work properly--when I'm lucky; it makes an\n> excellent desktop for beginners).\n\nHi, it's also not my preference, but Debian adheres to the FHS.\nUnfortunately /var/git is not allowed by the FHS, so a different\nlocation must be chosen for Debian.  I chose /var/cache/git/, and\nsuggested to populate that directory with symlinks to the repositories\nthat should be available through git-daemon or gitweb, see\nhttp://bugs.debian.org/483788\n\nRegards, Gerrit.\n"},{"id":"154454","messageId":"m3y69kj40i.fsf@localhost.localdomain","threadId":"25544","inReplyTo":"20101026152218.3931.qmail@d862ae2b10e11a.315fe32.mid.smarden.org","subject":"Re: Why /var/cache/git?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-26T16:47:55Z","receivedAt":"2010-10-26T16:47:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Gerrit Pape <pape@smarden.org> writes:\n> On Tue, Oct 26, 2010 at 09:21:39AM -0400, Drew Northup wrote:\n> > On Tue, 2010-10-26 at 12:22 +1100, Bron Gondwana wrote:\n\n> > > I have no problem with /var/git - it's /var/cache/git that worries\n> > > me, since the FHS quite clearly says that blowing away /var/cache/*\n> > > is not a problem.  It makes sense to back up /var/lib/ on any machine,\n> > > since that's somewhere that contains application data.  We already\n> > > back up a few things from /var/lib (like /var/lib/svn for example,\n> > > at least until we finish this switchover!)\n> > \n> > Doing a 'git grep \"/var\"' on the git sources and then searching that\n> > output for \"cache\" turns up nothing. I think you'd best bring this up\n> > with the Debian package maintainer. Debian is well known for thinking it\n> > knows better than the original authors where stuff should be--and that's\n> > why I don't run Debian as a server (too much time spent transliterating\n> > paths just to make stuff work properly--when I'm lucky; it makes an\n> > excellent desktop for beginners).\n> \n> Hi, it's also not my preference, but Debian adheres to the FHS.\n> Unfortunately /var/git is not allowed by the FHS, so a different\n> location must be chosen for Debian.  I chose /var/cache/git/, and\n> suggested to populate that directory with symlinks to the repositories\n> that should be available through git-daemon or gitweb, see\n> http://bugs.debian.org/483788\n\nWhere did you get '/var/git' from?  \"git grep /var/git\" finds it\nmentioned in one place in git-cvsserver manpage and in two places in\ngitweb/README.  But git-daemon and gitweb's defaults are /pub/scm/git\nor /pub/git - they are FHS-compatibile, aren't they?\n\nSo why Debian doesn't use either /pub/scm/git or /pub/git for \ngit-daemon, git-cvsserver and gitweb?\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"154457","messageId":"7viq0ohknn.fsf@alter.siamese.dyndns.org","threadId":"25544","inReplyTo":"20101026152218.3931.qmail@d862ae2b10e11a.315fe32.mid.smarden.org","subject":"Re: Why /var/cache/git?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-26T18:30:04Z","receivedAt":"2010-10-26T18:30:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Gerrit Pape <pape@smarden.org> writes:\n\n> Hi, it's also not my preference, but Debian adheres to the FHS.\n> Unfortunately /var/git is not allowed by the FHS, so a different\n> location must be chosen for Debian.\n\nIt seems that /var/lib/ seems to be more appropriate place to store\npersistent database-y stuff. I see e.g. /var/lib/postgresql there.\n"},{"id":"154462","messageId":"20101026205800.GA6544@brong.net","threadId":"25544","inReplyTo":"20101026152218.3931.qmail@d862ae2b10e11a.315fe32.mid.smarden.org","subject":"Re: Why /var/cache/git?","fromName":"Bron Gondwana","fromEmail":"brong@fastmail.fm","sentAt":"2010-10-26T20:58:00Z","receivedAt":"2010-10-26T20:58:00Z","isPatch":false,"sender":{"key":"brong@fastmail.fm","avatar":"https://gravatar.com/avatar/9b7b59d9f9f104cf348df27c705c0ab5537bd40f291b0adf7885d5d1cea10d00?d=mp&s=160"},"body":"On Tue, Oct 26, 2010 at 03:22:18PM +0000, Gerrit Pape wrote:\n> On Tue, Oct 26, 2010 at 09:21:39AM -0400, Drew Northup wrote:\n> > On Tue, 2010-10-26 at 12:22 +1100, Bron Gondwana wrote:\n> > > I have no problem with /var/git - it's /var/cache/git that worries\n> > > me, since the FHS quite clearly says that blowing away /var/cache/*\n> > > is not a problem.  It makes sense to back up /var/lib/ on any machine,\n> > > since that's somewhere that contains application data.  We already\n> > > back up a few things from /var/lib (like /var/lib/svn for example,\n> > > at least until we finish this switchover!)\n> > \n> > Bron,\n> > Doing a 'git grep \"/var\"' on the git sources and then searching that\n> > output for \"cache\" turns up nothing. I think you'd best bring this up\n> > with the Debian package maintainer. Debian is well known for thinking it\n> > knows better than the original authors where stuff should be--and that's\n> > why I don't run Debian as a server (too much time spent transliterating\n> > paths just to make stuff work properly--when I'm lucky; it makes an\n> > excellent desktop for beginners).\n> \n> Hi, it's also not my preference, but Debian adheres to the FHS.\n> Unfortunately /var/git is not allowed by the FHS, so a different\n> location must be chosen for Debian.  I chose /var/cache/git/, and\n> suggested to populate that directory with symlinks to the repositories\n> that should be available through git-daemon or gitweb, see\n> http://bugs.debian.org/483788\n\nMaybe you'd better read the FHS again to double check that you're\nadhering.\n\nhttp://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA\n\nPurpose:\n\n  /var/cache is intended for cached data from applications. \n  Such data is locally generated as a result of time-consuming \n  I/O or calculation. The application must be able to regenerate \n  or restore the data. \n\nI fail to see how git can regenerate the symlinks...\n\nBron.\n"},{"id":"154636","messageId":"20101028155302.11273.qmail@17f1bb531c10eb.315fe32.mid.smarden.org","threadId":"25544","inReplyTo":"7viq0ohknn.fsf@alter.siamese.dyndns.org","subject":"Re: Why /var/cache/git?","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2010-10-28T15:53:02Z","receivedAt":"2010-10-28T15:53:02Z","isPatch":false,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Tue, Oct 26, 2010 at 11:30:04AM -0700, Junio C Hamano wrote:\n> Gerrit Pape <pape@smarden.org> writes:\n> > Hi, it's also not my preference, but Debian adheres to the FHS.\n> > Unfortunately /var/git is not allowed by the FHS, so a different\n> > location must be chosen for Debian.\n> \n> It seems that /var/lib/ seems to be more appropriate place to store\n> persistent database-y stuff. I see e.g. /var/lib/postgresql there.\n\nI agree and re-opened\n http://bugs.debian.org/483788\n\nRegards, Gerrit.\n"}]}