{"thread":{"id":"15155","subject":"some questions","startedAt":"2008-08-22T07:31:13Z","lastAt":"2008-08-22T14:15:48Z","messageCount":5,"participants":["Thomas Pasch","Matthieu Moy","Jakub Narebski","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"88098","messageId":"48AE6B41.1070005@jentro.com","threadId":"15155","inReplyTo":null,"subject":"some questions","fromName":"Thomas Pasch","fromEmail":"thomas.pasch@jentro.com","sentAt":"2008-08-22T07:31:13Z","receivedAt":"2008-08-22T07:31:13Z","isPatch":false,"sender":{"key":"thomas.pasch@jentro.com","avatar":null},"body":"Hello,\n\nI try to migrate our old cvs repo to git.\nHowever, I still have to following questions\nthat I found difficult to answer with\nthe documentation.\n\n- Is there a way to convert a indexVersion 1\n  repo to indexVersion 2? (And vice versa?)\n\n- Is there a way to find out if a repository\n  is indexVersion 1 or indexVersion 2 (from\n  the pack/index files)?\n\n- http for git seems to be read-only/fetch.\n  Would it be (theoretically) possible to\n  support write/push (with WebDAV or so)?\n\n- I do not fully understand the implication\n  of 'git repack -a' (or 'git repack -A -d').\n  Is this bad for remote repos that are used\n  with http? (as '-a' is 'Especially useful when\n  packing a repository that is used for private\n  development and there is no need to worry about\n  people fetching via dumb protocols from it').\n\n- What would be the implication to mount the\n  git repo with nts (or another remote fs).\n  Is it save to use such a mounted repo from\n  more than one computer?\n\nKind regards,\n\nThomas\n\n-- \n"},{"id":"88108","messageId":"vpqtzddtoq2.fsf@bauges.imag.fr","threadId":"15155","inReplyTo":"48AE6B41.1070005@jentro.com","subject":"Re: some questions","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-08-22T08:53:41Z","receivedAt":"2008-08-22T08:53:41Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Thomas Pasch <thomas.pasch@jentro.com> writes:\n\n> Hello,\n>\n> I try to migrate our old cvs repo to git.\n> However, I still have to following questions\n> that I found difficult to answer with\n> the documentation.\n>\n> - Is there a way to convert a indexVersion 1\n>   repo to indexVersion 2? (And vice versa?)\n\nThe index itself is just a little file in .git/index. There might be a\nbetter solution, but just\n\n  rm .git/index\n  git reset\n\nseems to do it (of course, don't do while you have staged changes in\nthe index !).\n\n> - http for git seems to be read-only/fetch.\n>   Would it be (theoretically) possible to\n>   support write/push (with WebDAV or so)?\n\nhttp://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt\n\n(BTW, that's the first result in\nhttp://www.google.com/search?q=git+webdav ;-) )\n\n-- \nMatthieu\n"},{"id":"88111","messageId":"m3bpzls8ld.fsf@localhost.localdomain","threadId":"15155","inReplyTo":"48AE6B41.1070005@jentro.com","subject":"Re: some questions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-08-22T09:28:17Z","receivedAt":"2008-08-22T09:28:17Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Thomas Pasch <thomas.pasch@jentro.com> writes:\n\n> I try to migrate our old cvs repo to git.\n> However, I still have to following questions\n> that I found difficult to answer with\n> the documentation.\n> \n> - Is there a way to convert a indexVersion 1\n>   repo to indexVersion 2? (And vice versa?)\n\nI think the only solution is to simply remove index,\nensure configuration (pack.indexVersion), and recreate\nit using git-index-pack(1).\n \n> - Is there a way to find out if a repository\n>   is indexVersion 1 or indexVersion 2 (from\n>   the pack/index files)?\n\nThere is some magic number used to distinguish between\npack index version 1 and version 2.\n\nSee Documentation/technical/pack-format.txt for details.\n\n> - http for git seems to be read-only/fetch.\n>   Would it be (theoretically) possible to\n>   support write/push (with WebDAV or so)?\n\nIt *is* supported (via https).\n\nThere was even attempt to create 'smart' http\npush via web server module or CGI script, but\nIIRC it hit feature freeze and discussion petered\nout, so only parts of it are in 'pu'.\n\nSearch for \"Add Git-aware CGI for Git-aware smart\nHTTP transport\", \"More on git over HTTP POST\"\n\n  http://thread.gmane.org/gmane.comp.version-control.git/91104\n \n> - I do not fully understand the implication\n>   of 'git repack -a' (or 'git repack -A -d').\n>   Is this bad for remote repos that are used\n>   with http? (as '-a' is 'Especially useful when\n>   packing a repository that is used for private\n>   development and there is no need to worry about\n>   people fetching via dumb protocols from it').\n\nDumb protocols currently _always_ download whole packfiles,\nso if you want to serve dumb protocols you might want to\noffer (also?) smaller packfiles.  You can, for example,\nuse .keep files and 'git repack -a' wouldn't matter.\n\nYou can try to search archives for \"generational packing\"\nor something like that...\n\n> - What would be the implication to mount the\n>   git repo with nts (or another remote fs).\n>   Is it save to use such a mounted repo from\n>   more than one computer?\n\nShould work without problems, _unless_ you mean that\nyou want to use multiple working directories with single\nrepository.  Then there are a couple of thing that you\nhave to be beware of (but you can instead use alternates\nmechanism).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"88133","messageId":"20080822140832.GC3483@spearce.org","threadId":"15155","inReplyTo":"vpqtzddtoq2.fsf@bauges.imag.fr","subject":"Re: some questions","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-08-22T14:08:32Z","receivedAt":"2008-08-22T14:08:32Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Thomas Pasch <thomas.pasch@jentro.com> writes:\n> >\n> > I try to migrate our old cvs repo to git.\n> > However, I still have to following questions\n> > that I found difficult to answer with\n> > the documentation.\n> >\n> > - Is there a way to convert a indexVersion 1\n> >   repo to indexVersion 2? (And vice versa?)\n> \n> The index itself is just a little file in .git/index. There might be a\n> better solution, but just\n> \n>   rm .git/index\n>   git reset\n> \n> seems to do it (of course, don't do while you have staged changes in\n> the index !).\n\nTrue, that would reset the dircache (aka .git/index).  But we only\nhave effectively 1 version of the dircache.  Sure there was an older\nversion, way back before it got a version header and the ability to\nget extension sections added.  I don't think there are many clients\nusing that format anymore.  That format predates the 1.4 series,\nand we really encourage people to be on 1.5 or later.\n\nThe original poster asked about indexVersion 1 and indexVersion 2,\nwhich means he is probably talking about pack.indexVersion and thus\na .idx file alongside a pack, not the dircache file that tracks\nthe working tree state.\n \n-- \nShawn.\n"},{"id":"88135","messageId":"20080822141548.GD3483@spearce.org","threadId":"15155","inReplyTo":"m3bpzls8ld.fsf@localhost.localdomain","subject":"Re: some questions","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-08-22T14:15:48Z","receivedAt":"2008-08-22T14:15:48Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> wrote:\n> Thomas Pasch <thomas.pasch@jentro.com> writes:\n> \n> > I try to migrate our old cvs repo to git.\n> > However, I still have to following questions\n> > that I found difficult to answer with\n> > the documentation.\n> > \n> > - Is there a way to convert a indexVersion 1\n> >   repo to indexVersion 2? (And vice versa?)\n> \n> I think the only solution is to simply remove index,\n> ensure configuration (pack.indexVersion), and recreate\n> it using git-index-pack(1).\n\nJust change pack.indexVersion in .git/config to have the version\nyou want and run `git gc` to repack the repository.  If you created\nthis repository by cloning another you may need to first delete\nany .keep files:\n\n\trm -f .git/objects/pack/*.keep\n  \n> > - Is there a way to find out if a repository\n> >   is indexVersion 1 or indexVersion 2 (from\n> >   the pack/index files)?\n> \n> There is some magic number used to distinguish between\n> pack index version 1 and version 2.\n> \n> See Documentation/technical/pack-format.txt for details.\n\n  for i in .git/objects/pack/pack-*.idx; do\n  dd if=$i bs=12 count=1 | od -c\n  done\n\nA line like:\n\n0000000   �   t   O   c  \\0  \\0  \\0 002  \\0  \\0  \\0 002\n\nindicates index version 2, as it has the magic byte sequence in\nfront of '\\xFFt0c'.  Most version 1 indexes will have 2 zeros\nin the first two bytes:\n\n0000000  \\0  \\0  \\0  \\0  \\0  \\0  \\0 001  \\0  \\0  \\0 003\n\n> > - http for git seems to be read-only/fetch.\n> >   Would it be (theoretically) possible to\n> >   support write/push (with WebDAV or so)?\n> \n> It *is* supported (via https).\n> \n> There was even attempt to create 'smart' http\n> push via web server module or CGI script, but\n> IIRC it hit feature freeze and discussion petered\n> out, so only parts of it are in 'pu'.\n> \n> Search for \"Add Git-aware CGI for Git-aware smart\n> HTTP transport\", \"More on git over HTTP POST\"\n> \n>   http://thread.gmane.org/gmane.comp.version-control.git/91104\n\nI'm picking this up again and working on it more.  Its not dead.\n  \n> > - What would be the implication to mount the\n> >   git repo with nts (or another remote fs).\n> >   Is it save to use such a mounted repo from\n> >   more than one computer?\n\nI've found that accessing a Git pack file over a network file\nsystem like NFS or SMB is kinda slow.  The issue is we do many\nreads scattered throughout the file.  Its hard for the client\nto batch up reads and hide the network latency.\n\nYou may get better performance by building Git without mmap\nsupport:\n\n\tmake NO_MMAP=1\n\nbut that is going to hurt access to local files.\n\n-- \nShawn.\n"}]}