git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: some questions

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 22, 2008, 14:15 UTC
Message-ID
<20080822141548.GD3483@spearce.org>
In-Reply-To
<m3bpzls8ld.fsf@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> wrote:
Show 13 quoted lines
> Thomas Pasch <thomas.pasch@jentro.com> writes:
> 
> > I try to migrate our old cvs repo to git.
> > However, I still have to following questions
> > that I found difficult to answer with
> > the documentation.
> > 
> > - Is there a way to convert a indexVersion 1
> >   repo to indexVersion 2? (And vice versa?)
> 
> I think the only solution is to simply remove index,
> ensure configuration (pack.indexVersion), and recreate
> it using git-index-pack(1).

Just change pack.indexVersion in .git/config to have the version you want and run `git gc` to repack the repository. If you created this repository by cloning another you may need to first delete any .keep files:

	rm -f .git/objects/pack/*.keep
  
Show 8 quoted lines
> > - Is there a way to find out if a repository
> >   is indexVersion 1 or indexVersion 2 (from
> >   the pack/index files)?
> 
> There is some magic number used to distinguish between
> pack index version 1 and version 2.
> 
> See Documentation/technical/pack-format.txt for details.
  for i in .git/objects/pack/pack-*.idx; do
  dd if=$i bs=12 count=1 | od -c
  done
A line like:
0000000   �   t   O   c  \0  \0  \0 002  \0  \0  \0 002

indicates index version 2, as it has the magic byte sequence in front of '\xFFt0c'. Most version 1 indexes will have 2 zeros in the first two bytes:

0000000  \0  \0  \0  \0  \0  \0  \0 001  \0  \0  \0 003
Show 15 quoted lines
> > - http for git seems to be read-only/fetch.
> >   Would it be (theoretically) possible to
> >   support write/push (with WebDAV or so)?
> 
> It *is* supported (via https).
> 
> There was even attempt to create 'smart' http
> push via web server module or CGI script, but
> IIRC it hit feature freeze and discussion petered
> out, so only parts of it are in 'pu'.
> 
> Search for "Add Git-aware CGI for Git-aware smart
> HTTP transport", "More on git over HTTP POST"
> 
>   http://thread.gmane.org/gmane.comp.version-control.git/91104
I'm picking this up again and working on it more.  Its not dead.
  
> > - What would be the implication to mount the
> >   git repo with nts (or another remote fs).
> >   Is it save to use such a mounted repo from
> >   more than one computer?

I've found that accessing a Git pack file over a network file system like NFS or SMB is kinda slow. The issue is we do many reads scattered throughout the file. Its hard for the client to batch up reads and hide the network latency.

You may get better performance by building Git without mmap support:

	make NO_MMAP=1
but that is going to hurt access to local files.
-- 
Shawn.
Previous: Jakub Narebski
Message 5 of 5 in “some questions”
  1. Thomas PaschAug 22, 2008
  2. Matthieu MoyAug 22, 2008
  3. Shawn O. PearceAug 22, 2008
  4. Jakub NarebskiAug 22, 2008
  5. Shawn O. PearceAug 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.