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

Re: [PATCH 3/3] git-svn: use YAML format for mergeinfo cache when possible

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 13, 2012, 01:34 UTC
Message-ID
<20120613013446.GA3759@burratino>
In-Reply-To
<20120609223535.GG28412@burratino>
Jonathan Nieder wrote:
> Unfortunately the format is *not* independent of the perl version ---
> new perl versions will write files that very old perl cannot read.
True and documented.
Show 5 quoted lines
> Worse, the format is not independent of the size of a perl integer.
> So if you toggle perl's use64bitint compile-time option, then using
> 'git svn fetch' on your old repositories produces errors like this:
>
>	Byte order is not compatible at ../../lib/Storable.pm (autosplit

Weird and contrary to documentation. First, why byte order? Wouldn't the problem be word size, if anything? nstore implies network-endian, after all.

Examining the cache file explains it:
	$ xxd <.git/svn/.caches/lookup_svn_merge.db | head -1
	0000000: 7073 7430 0408 0831 3233 3435 3637 3804  pst0...12345678.

The byte order is "12345678", which reflects both endianness and word size.

Notice that the format is not network-endian. That is because Memoize::Storable ignores the 'nstore' option, for silly reasons:

	https://rt.cpan.org/Public/Bug/Display.html?id=77790
Ah.  (Thanks to Tim Retout for noticing.)

Avoiding this arcane and fragile facility when possible still seems to me like a reasonable behavior for git-svn, but it's also nice to see that the problem will eventually fix itself. Sorry for the confusion.

And until then, using a renamed cache with a format (YAML) known to be platform-agnostic means git-svn can keep working on repositories that have caches written by unfixed versions of perl.

Ciao, Jonathan

Previous: Jonathan NiederNext: Eric Wong
Message 23 of 26 in “git-svn: Destroy the cache when we fail to read it”
  1. git-svn: Destroy the cache when we fail to read itJason Gross, Aug 22, 2011
  2. Jason GrossAug 22, 2011
  3. Add tests for handling corrupted cachesJason Gross, Aug 22, 2011
  4. Jonathan NiederAug 23, 2011
  5. Jonathan NiederAug 23, 2011
  6. Jason GrossAug 23, 2011
  7. Eric WongAug 23, 2011
  8. Junio C HamanoAug 23, 2011
  9. Eric WongAug 23, 2011
  10. git-svn: use YAML format for mergeinfo cache when possibleJonathan Nieder, May 27, 2012
  11. 2/1 fixup! git-svn: use YAML format for mergeinfo cache when possibleJonathan Nieder, May 27, 2012
  12. Eric WongMay 27, 2012
  13. Jonathan NiederMay 28, 2012
  14. 0/2 git-svn: give SVN::Git::Fetcher its own fileJonathan Nieder, May 28, 2012
  15. 1/2 git-svn: rename SVN::Git::* packages to Git::SVN::*Jonathan Nieder, May 28, 2012
  16. 2/2 git-svn: make Git::SVN::Fetcher a separate fileJonathan Nieder, May 28, 2012
  17. Eric WongMay 29, 2012
  18. Junio C HamanoMay 29, 2012
  19. 0/3 git-svn: use YAML format for mergeinfo cache when possibleJonathan Nieder, Jun 9, 2012
  20. 1/3 git-svn: make Git::SVN::Editor a separate fileJonathan Nieder, Jun 9, 2012
  21. 2/3 git-svn: make Git::SVN::RA a separate fileJonathan Nieder, Jun 9, 2012
  22. 3/3 git-svn: use YAML format for mergeinfo cache when possibleJonathan Nieder, Jun 9, 2012
  23. Jonathan NiederJun 13, 2012
  24. Eric WongJun 10, 2012
  25. Jonathan NiederJun 10, 2012
  26. Junio C HamanoJun 11, 2012

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.